<commit_before>class City < ActiveRecord::Base
  belongs_to      :state
  named_scope     :state_like, lambda {|name| {:include => [:state], :conditions => ["states.name = ? or states.abbr = ?",name, name]}}
  
  #TODO change searchlogic to default rails
  def self.find_by_full_name(full_name)
    unless full_name.blank?
      city_name, state_name = full_name.split(",")
      @cities = City.all(:conditions => {:name => city_name.strip})
      if state_name and state_name.strip.size > 2
        @cities = @cities.state_like(state_name.strip) 
      elsif state_name
        @cities = @cities.state_abbr_is(state_name.strip.upcase) 
      end
      @cities
    else
      []
    end
  end
  
end<commit_msg>Uses searchlogic in city search_for. must be declared as a dependency<commit_after>class City < ActiveRecord::Base
  belongs_to      :state
  named_scope     :state_like, lambda {|name| {:include => [:state], :conditions => ["states.name = ? or states.abbr = ?",name, name]}}
  
  def self.find_by_full_name(full_name)
    unless full_name.blank?
      city_name, state_name = full_name.split(",")
      @cities = City.name_is(city_name.strip)
      if state_name and state_name.strip.size > 2
        @cities = @cities.state_like(state_name.strip) 
      elsif state_name
        @cities = @cities.state_abbr_is(state_name.strip.upcase) 
      end
      @cities
    else
      []
    end
  end
  
end
{'fraction_non_alphanumeric': 0.11614730878186968, 'fraction_numerical': 0.00141643059490085, 'mean_word_length': 3.037142857142857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '2396594', 'n_tokens_mistral': 490, 'n_tokens_neox': 481, 'n_words': 103}