diff options
| author | hukl <contact@smyck.org> | 2009-02-17 12:47:49 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-17 12:47:49 +0100 |
| commit | 3cdcb5ca02a94b2b342c30903a27d47d35d46e55 (patch) | |
| tree | ef3e1154fe262561b3955c07edcaee3824a21f47 /vendor/plugins/will_paginate/test/fixtures/topic.rb | |
| parent | 7a282f2605f6fb3689940e5c7072b4801653deb2 (diff) | |
added will_paginate plugin
Diffstat (limited to 'vendor/plugins/will_paginate/test/fixtures/topic.rb')
| -rw-r--r-- | vendor/plugins/will_paginate/test/fixtures/topic.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/plugins/will_paginate/test/fixtures/topic.rb b/vendor/plugins/will_paginate/test/fixtures/topic.rb new file mode 100644 index 00000000..2c2ce722 --- /dev/null +++ b/vendor/plugins/will_paginate/test/fixtures/topic.rb | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | class Topic < ActiveRecord::Base | ||
| 2 | has_many :replies, :dependent => :destroy, :order => 'replies.created_at DESC' | ||
| 3 | belongs_to :project | ||
| 4 | |||
| 5 | named_scope :mentions_activerecord, :conditions => ['topics.title LIKE ?', '%ActiveRecord%'] | ||
| 6 | |||
| 7 | named_scope :with_replies_starting_with, lambda { |text| | ||
| 8 | { :conditions => "replies.content LIKE '#{text}%' ", :include => :replies } | ||
| 9 | } | ||
| 10 | end | ||
