Sha256: eb7d1ca9131b2d10278c38e6d1b4dbc93773b8030b5d9eb1823add51e098e835

Contents?: true

Size: 522 Bytes

Versions: 7

Compression:

Stored size: 522 Bytes

Contents

class Project < ActiveRecord::Base
  has_and_belongs_to_many :developers, :uniq => true
  
  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 = {})
      scoped.where(['replies.created_at > ?', 15.minutes.ago])
    end
  end

  has_many :unique_replies, :through => :topics, :source => :replies, :uniq => true
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
hobo_will_paginate-2.1.1 spec/fixtures/project.rb
hobo_will_paginate-2.1.0 spec/fixtures/project.rb
hobo-will_paginate-3.0.4.hobo spec/fixtures/project.rb
will_paginate-3.0.3 spec/fixtures/project.rb
will_paginate-3.0.2 spec/fixtures/project.rb
will_paginate-3.0.1 spec/fixtures/project.rb
will_paginate-3.0.0 spec/fixtures/project.rb