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