Sha256: a9b1e8cb36ccafcbac7804974edf0f562dc53186d723e0f37afa1da6f7f03fab

Contents?: true

Size: 453 Bytes

Versions: 17

Compression:

Stored size: 453 Bytes

Contents

class Project < ActiveRecord::Base
  has_and_belongs_to_many :developers, :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

17 entries across 17 versions & 1 rubygems

Version Path
will_paginate-3.3.1 spec/fixtures/project.rb
will_paginate-3.3.0 spec/fixtures/project.rb
will_paginate-3.2.1 spec/fixtures/project.rb
will_paginate-3.2.0 spec/fixtures/project.rb
will_paginate-3.1.8 spec/fixtures/project.rb
will_paginate-3.1.7 spec/fixtures/project.rb
will_paginate-3.1.6 spec/fixtures/project.rb
will_paginate-3.0.12 spec/fixtures/project.rb
will_paginate-3.1.5 spec/fixtures/project.rb
will_paginate-3.0.11 spec/fixtures/project.rb
will_paginate-3.1.3 spec/fixtures/project.rb
will_paginate-3.0.10 spec/fixtures/project.rb
will_paginate-3.0.9 spec/fixtures/project.rb
will_paginate-3.1.2 spec/fixtures/project.rb
will_paginate-3.1.1 spec/fixtures/project.rb
will_paginate-3.0.8 spec/fixtures/project.rb
will_paginate-3.1.0 spec/fixtures/project.rb