Sha256: be012f3160846527514b481654bfd28ff0023fbb1ac36bff070e1b806e353f37
Contents?: true
Size: 488 Bytes
Versions: 18
Compression:
Stored size: 488 Bytes
Contents
class Company < ActiveRecord::Base attr_protected :rating set_sequence_name :companies_nonstd_seq validates_presence_of :name def validate errors.add('rating', 'rating should not be 2') if rating == 2 end def self.with_best with_scope :find => { :conditions => ['companies.rating > ?', 3] } do yield end end def self.find_best(*args) with_best { find(*args) } end def self.calculate_best(*args) with_best { calculate(*args) } end end
Version data entries
18 entries across 18 versions & 5 rubygems