summaryrefslogtreecommitdiff
path: root/vendor/plugins/will_paginate/test/fixtures/developer.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-02-17 12:47:49 +0100
committerhukl <contact@smyck.org>2009-02-17 12:47:49 +0100
commit3cdcb5ca02a94b2b342c30903a27d47d35d46e55 (patch)
treeef3e1154fe262561b3955c07edcaee3824a21f47 /vendor/plugins/will_paginate/test/fixtures/developer.rb
parent7a282f2605f6fb3689940e5c7072b4801653deb2 (diff)
added will_paginate plugin
Diffstat (limited to 'vendor/plugins/will_paginate/test/fixtures/developer.rb')
-rw-r--r--vendor/plugins/will_paginate/test/fixtures/developer.rb14
1 files changed, 14 insertions, 0 deletions
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 0000000..0224f4b
--- /dev/null
+++ b/vendor/plugins/will_paginate/test/fixtures/developer.rb
@@ -0,0 +1,14 @@
1class Developer < User
2 has_and_belongs_to_many :projects, :include => :topics, :order => 'projects.name'
3
4 def self.with_poor_ones(&block)
5 with_scope :find => { :conditions => ['salary <= ?', 80000], :order => 'salary' } do
6 yield
7 end
8 end
9
10 named_scope :distinct, :select => 'DISTINCT `users`.*'
11 named_scope :poor, :conditions => ['salary <= ?', 80000], :order => 'salary'
12
13 def self.per_page() 10 end
14end