<commit_before>class StocksController < ApplicationController
  # include ApplicationHelper

  def index
    # redirect_to root_path
    render json: {stocks: Stock.stock_autocomplete_array}
  end

  def create
    # default value of period is 30 days if it is left blanked
    params[:period] = 30 if params[:period] == ""

    @stock = Stock.new(symbol: params[:symbol].upcase)

    if request.xhr?
      @stock.save
      @data = YahooFinanceDataCollector.get_price_data(@stock.symbol, params[:period].to_i)
      render json: @data
    end
  end
end<commit_msg>update create action to not create stock symbol in the database, minor code cleanup<commit_after>class StocksController < ApplicationController
  # include ApplicationHelper

  def index
    render json: {stocks: Stock.stock_autocomplete_array}
  end

  def create
    # default value of period is 30 days if it is left blanked
    params[:period] = 30 if params[:period] == ""

    if request.xhr?
      @data = YahooFinanceDataCollector.get_price_data(params[:symbol], params[:period].to_i)
      render json: @data
    end
  end
end
{'fraction_non_alphanumeric': 0.08272727272727273, 'fraction_numerical': 0.007272727272727273, 'mean_word_length': 3.725321888412017, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6120683', 'n_tokens_mistral': 335, 'n_tokens_neox': 315, 'n_words': 100}