mailr/vendor/plugins/will_paginate/spec/fixtures/developer.rb

14 lines
371 B
Ruby
Raw Normal View History

2009-02-09 19:13:08 +01:00
class Developer < User
has_and_belongs_to_many :projects, :include => :topics, :order => 'projects.name'
def self.with_poor_ones(&block)
with_scope :find => { :conditions => ['salary <= ?', 80000], :order => 'salary' } do
yield
end
end
named_scope :poor, :conditions => ['salary <= ?', 80000], :order => 'salary'
def self.per_page() 10 end
end