Module: ActiveRecord::Acts::Readable::SingletonMethods
- Defined in:
- lib/acts-as-readable.rb
Instance Method Summary collapse
Instance Method Details
#find_read_by(user) ⇒ Object
23 24 25 |
# File 'lib/acts-as-readable.rb', line 23 def find_read_by(user) find(:all, :conditions => ["readings.readable_id = #{table_name}.id AND readings.user_id=?", user.id], :include => :readings) end |
#find_unread_by(user) ⇒ Object
19 20 21 |
# File 'lib/acts-as-readable.rb', line 19 def find_unread_by(user) find(:all) - find_read_by(user) end |