<commit_before>module Spree
  class Workshop < ActiveRecord::Base
    attr_accessible :name, :address, :town_id, :phone, :fax, :email, :notes,
                    :price_for_car, :price_for_moto, :province
    attr_accessor :province
    belongs_to :town
    validates_format_of :email,
                        :with    => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,
                        :message => "email incorrecto",
                        :unless => "email.blank?"
    validates :town_id, :address, :name, :presence => true

    scope :by_state, lambda { |state|
    joins(:town).where("spree_towns.state_id = ?", state)
  }
    scope :all_states, joins(:town).all
  end
end<commit_msg>New Workshop search<commit_after>module Spree
  class Workshop < ActiveRecord::Base
    attr_accessible :name, :address, :town_id, :phone, :fax, :email, :notes,
                    :price_for_car, :price_for_moto, :province
    attr_accessor :province
    belongs_to :town
    validates_format_of :email,
                        :with    => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,
                        :message => "email incorrecto",
                        :unless => "email.blank?"
    validates :town_id, :address, :name, :presence => true

    scope :by_state, lambda { |state|
    joins(:town).where("spree_towns.state_id = ?", state)
  }
    scope :all_states, joins(:town)
  end
end
{'fraction_non_alphanumeric': 0.16163793103448276, 'fraction_numerical': 0.004310344827586207, 'mean_word_length': 2.448019801980198, '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': '637376', 'n_tokens_mistral': 487, 'n_tokens_neox': 465, 'n_words': 93}