From 3cdcb5ca02a94b2b342c30903a27d47d35d46e55 Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 17 Feb 2009 12:47:49 +0100 Subject: added will_paginate plugin --- vendor/plugins/will_paginate/test/fixtures/developer.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 vendor/plugins/will_paginate/test/fixtures/developer.rb (limited to 'vendor/plugins/will_paginate/test/fixtures/developer.rb') diff --git a/vendor/plugins/will_paginate/test/fixtures/developer.rb b/vendor/plugins/will_paginate/test/fixtures/developer.rb new file mode 100644 index 00000000..0224f4bf --- /dev/null +++ b/vendor/plugins/will_paginate/test/fixtures/developer.rb @@ -0,0 +1,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 -- cgit v1.3