acts_as_notifiable 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,8 +30,8 @@ module ActsAsNotifiable
30
30
  private
31
31
 
32
32
  def self.polymorphic_queries(notifications, type, type_id)
33
- notifications = notifications.where(polymorphic_type: type)
34
- notifications = notifications.where(polymorphic_id: type_id) if type_id
33
+ notifications = notifications.where(parent_type: type)
34
+ notifications = notifications.where(parent_id: type_id) if type_id
35
35
  notifications
36
36
  end
37
37
 
@@ -61,7 +61,7 @@ module ActsAsNotifiable
61
61
  def create_notification
62
62
  if self.class.polymorphic?
63
63
  polymorphic_array = polymorphic_sender
64
- Notification.find_or_create_by_user_id_and_notifiable_id_and_notifiable_type_and_polymorphic_type_and_polymorphic_id(self.user_id, self.id, self.class.to_s, polymorphic_array[0], polymorphic_array[1])
64
+ Notification.find_or_create_by_user_id_and_notifiable_id_and_notifiable_type_and_parent_type_and_parent_id(self.user_id, self.id, self.class.to_s, polymorphic_array[0], polymorphic_array[1])
65
65
  else
66
66
  Notification.find_or_create_by_user_id_and_notifiable_id_and_notifiable_type(self.user_id, self.id, self.class.to_s)
67
67
  end
@@ -1,6 +1,6 @@
1
1
  class Notification < ActiveRecord::Base
2
2
 
3
- attr_accessible :user_id, :notifiable_id, :notifiable_type, :delivered, :polymorphic_id, :polymorphic_type
3
+ attr_accessible :user_id, :notifiable_id, :notifiable_type, :delivered, :parent_id, :parent_type
4
4
 
5
5
  # Validations
6
6
  validates_presence_of :user_id, :notifiable_id, :notifiable_type
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_notifiable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: