<commit_before>class SearchesController < ApplicationController


 	def index
    render :"buildings/building_profile"
  end

	def new
    # render :"reports/report"
		# do i need to pass form params here? Can I?
		# "You made it!"

	end

	def create
		@search = Search.new(params[:address], params[:zip_code])
		render json: @search 
	end

def show
    @building = Building.find(params[:id])
    @score = @building.badge_score


    @report_categories = ["Select...", "LeaseIncrease", "MaintenenceIssue", "EvictionNotice", "OtherHarassment"]

    @letter_options = ["Ellis Act", "Landlord Move-In", "Condo Conversion"]

    @building = Building.where(id: params[:id]).first

    @reports_array = []
    @building.harassments.each do |report|
      @reports_array << report
    end

    @building.fix_orders.each do |report|
      @reports_array << report
    end

    @building.eviction_notices.each do |report|
      @reports_array << report
    end

    @building.rent_notices.each do |report|
      @reports_array << report
    end

  @reports_array.sort!{|a,b|a.updated_at <=> b.updated_at}

  @reports_array = @reports_array.first(10)

    render :"buildings/building_profile"
    # render json:  @building
  end

end
<commit_msg>passing new search object into Create path<commit_after>class SearchesController < ApplicationController


 	def index
    render :"buildings/building_profile"
  end

	def new
    # render :"reports/report"
		# do i need to pass form params here? Can I?
		# "You made it!"

	end

	def create
		@search = Search.new(address:params[:address], zip_code:params[:zip_code])
		render json: @search 
	end

def show
    @building = Building.find(params[:id])
    @score = @building.badge_score


    @report_categories = ["Select...", "LeaseIncrease", "MaintenenceIssue", "EvictionNotice", "OtherHarassment"]

    @letter_options = ["Ellis Act", "Landlord Move-In", "Condo Conversion"]

    @building = Building.where(id: params[:id]).first

    @reports_array = []
    @building.harassments.each do |report|
      @reports_array << report
    end

    @building.fix_orders.each do |report|
      @reports_array << report
    end

    @building.eviction_notices.each do |report|
      @reports_array << report
    end

    @building.rent_notices.each do |report|
      @reports_array << report
    end

  @reports_array.sort!{|a,b|a.updated_at <=> b.updated_at}

  @reports_array = @reports_array.first(10)

    render :"buildings/building_profile"
    # render json:  @building
  end

end

{'fraction_non_alphanumeric': 0.12152501985702939, 'fraction_numerical': 0.0015885623510722795, 'mean_word_length': 3.5387387387387386, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 5, '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': '5985976', 'n_tokens_mistral': 876, 'n_tokens_neox': 801, 'n_words': 192}