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

Version Path
cehoffman-acts_as_ferret-0.4.4 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
jkraemer-acts_as_ferret-0.4.4 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
watson-acts_as_ferret-0.4.8.2 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.5.2 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.4.8.2 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.4.8.1 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.5.1 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.5 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.4.8.rails3 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.4.8 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.4.7 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.4.6 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
acts_as_ferret-0.4.4 doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
ambition-0.2.0 ./test/databases/fixtures/company.rb
ambition-0.2.1 ./test/databases/fixtures/company.rb
ambition-0.1.6 ./test/databases/fixtures/company.rb
ambition-0.2.2 ./test/databases/fixtures/company.rb
ambition-0.3.1 ./test/databases/fixtures/company.rb