Module: Lifesaver::Notification::ModelAdditions::ClassMethods

Defined in:
lib/lifesaver/notification/model_additions.rb

Instance Method Summary collapse

Instance Method Details

#load_with_notifiable_associations(ids) ⇒ Object



12
13
14
# File 'lib/lifesaver/notification/model_additions.rb', line 12

def load_with_notifiable_associations(ids)
  includes(notifiable_associations.on_notify).where(id: ids)
end

#notifies_for_indexing(*args) ⇒ Object



5
6
7
8
9
10
# File 'lib/lifesaver/notification/model_additions.rb', line 5

def notifies_for_indexing(*args)
  self.notifiable_associations = NotifiableAssociations.new
  options = args.last.is_a?(Hash) ? args.pop : {}
  notifiable_associations.populate(args, options)
  notification_callbacks
end