<commit_before>class BuildingsController < ApplicationController

  def new
    @building = Building.new
  end

  def index
  end

  #Create a new building object based on the user input in order to render the view.  It is not saved to the database.
  # :street in building_params needs to be upcase to match the database records (which are all upcased)
  def create
    search = building_params
    search[:street] = search[:street].upcase
    @building = Building.find_by(search)

    if !@building 
      @building = Building.new(building_params)
    end
    render 'show'
  end

  #Buildings with zipcodes are in the database since the form does not prompt the user to provide a zip
  def in_database?
    !!@building.zip
  end
  helper_method :in_database?

  #fix queens
  def get_office
    @office = Office.find_by(:city => params[:building][:borough].upcase)
  end
  helper_method :get_office


  private
  def building_params
    params.require(:building).permit(:building_num, :street, :street_suffix)
  end

end<commit_msg>fix maps except queens and manhattan<commit_after>class BuildingsController < ApplicationController

  def new
    @building = Building.new
  end

  def index
  end

  #Create a new building object based on the user input in order to render the view.  It is not saved to the database.
  # :street in building_params needs to be upcase to match the database records (which are all upcased)
  def create
    search = building_params
    search[:street] = search[:street].upcase
    @building = Building.find_by(search)

    if !@building 
      @building = Building.new(building_params)
    end
    render 'show'
  end

  #Buildings with zipcodes are in the database since the form does not prompt the user to provide a zip
  def in_database?
    !!@building.zip
  end
  helper_method :in_database?

  #fix queens
  def get_office
      @office = Office.find_by(:city => params[:building][:borough].upcase)
  end
  helper_method :get_office


  private
  def building_params
    params.require(:building).permit(:building_num, :street, :street_suffix)
  end

end
{'fraction_non_alphanumeric': 0.07064439140811456, 'fraction_numerical': 0.0, 'mean_word_length': 3.616740088105727, 'pattern_counts': {'":': 0, '<': 5, '<?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': '236249', 'n_tokens_mistral': 638, 'n_tokens_neox': 601, 'n_words': 222}