Module: UnreadMongoid::Base
- Defined in:
- lib/unread_mongoid/base.rb
Instance Method Summary collapse
Instance Method Details
#acts_as_readable ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/unread_mongoid/base.rb', line 13 def acts_as_readable has_many :read_marks, as: :readable, dependent: :destroy before_save do |readable| readable.mark_as_unread! end include Readable::InstanceMethods extend Readable::ClassMethods extend Readable::Scopes end |
#acts_as_reader ⇒ Object
7 8 9 10 11 |
# File 'lib/unread_mongoid/base.rb', line 7 def acts_as_reader has_many :read_marks, as: :reader, dependent: :destroy include Reader end |