Sha256: 8d1a800f764abf9f82909eef274330ee25b5a57c4293d5040387a5d05c983af5

Contents?: true

Size: 560 Bytes

Versions: 2

Compression:

Stored size: 560 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 = {})
      scoped.where(['replies.created_at > ?', 15.minutes.ago])
    end
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
will_paginate-3.0.5 spec/fixtures/project.rb
will_paginate-3.0.4 spec/fixtures/project.rb