Sha256: 8c3210e91789b62379c3e067369e13765c182ce4207cf9c83597574166f7657b

Contents?: true

Size: 468 Bytes

Versions: 3

Compression:

Stored size: 468 Bytes

Contents

class Project < ActiveRecord::Base
  has_and_belongs_to_many :developers, :uniq => true, :join_table => 'developers_projects'
  
  has_many :topics
    # :finder_sql  => 'SELECT * FROM topics WHERE (topics.project_id = #{id})',
    # :counter_sql => 'SELECT COUNT(*) FROM topics WHERE (topics.project_id = #{id})'
  
  has_many :replies, :through => :topics do
    def only_recent(params = {})
      where(['replies.created_at > ?', 15.minutes.ago])
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
will_paginate_seo-3.0.4 spec/fixtures/project.rb
will_paginate-3.0.7 spec/fixtures/project.rb
will_paginate-3.0.6 spec/fixtures/project.rb