Sha256: 70e4f5e4719f29b4aa7f74b23e847e737783a95409298b1aabd904c2ba558293

Contents?: true

Size: 586 Bytes

Versions: 8

Compression:

Stored size: 586 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 find_recent(params = {})
      with_scope :find => { :conditions => ['replies.created_at > ?', 15.minutes.ago] } do
        find :all, params
      end
    end
  end

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

Version data entries

8 entries across 8 versions & 5 rubygems

Version Path
will_paginate-2.3.17 test/fixtures/project.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/will_paginate-2.3.16/test/fixtures/project.rb
will_mostly_paginate-2.4.3 test/fixtures/project.rb
will_paginate-2.3.16 test/fixtures/project.rb
tism-will_paginate-2.3.16 test/fixtures/project.rb
will_mostly_paginate-2.4.2 test/fixtures/project.rb
Empact-will_paginate-2.3.15 test/fixtures/project.rb
will_paginate-2.3.15 test/fixtures/project.rb