acts_as_notifiable 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/acts_as_notifiable/notifiable.rb +2 -2
- metadata +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
module ActsAsNotifiable
|
2
2
|
def acts_as_notifiable(options={})
|
3
|
-
has_many :notifications, as: :notifiable, dependent: :
|
3
|
+
has_many :notifications, as: :notifiable, dependent: :destroy
|
4
4
|
|
5
5
|
after_create :create_notification
|
6
6
|
|
@@ -17,7 +17,7 @@ module ActsAsNotifiable
|
|
17
17
|
def self.mark_all_noticed_by(user, type=nil, type_id=nil)
|
18
18
|
@notifications = Notification.where(user_id: user.id, notifiable_type: self.to_s)
|
19
19
|
self.polymorphic_queries(type, type_id)
|
20
|
-
@notifications.
|
20
|
+
@notifications.destroy_all
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|