summaryrefslogtreecommitdiff
path: root/vendor/plugins/will_paginate/test/fixtures/developer.rb
blob: 0224f4bf8e26ea39a748fd8a542291b6d822ab6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 :distinct, :select => 'DISTINCT `users`.*'
  named_scope :poor, :conditions => ['salary <= ?', 80000], :order => 'salary'

  def self.per_page() 10 end
end