summaryrefslogtreecommitdiff
path: root/vendor/plugins/will_paginate/test/fixtures/topic.rb
blob: 2c2ce722991441bde87696183b062baf48a5235a (plain)
1
2
3
4
5
6
7
8
9
10
class Topic < ActiveRecord::Base
  has_many :replies, :dependent => :destroy, :order => 'replies.created_at DESC'
  belongs_to :project

  named_scope :mentions_activerecord, :conditions => ['topics.title LIKE ?', '%ActiveRecord%']
  
  named_scope :with_replies_starting_with, lambda { |text|
    { :conditions => "replies.content LIKE '#{text}%' ", :include  => :replies }
  }
end