lib/notifiable/notification.rb in notifiable-rails-0.21.0 vs lib/notifiable/notification.rb in notifiable-rails-0.21.1
- old
+ new
@@ -2,11 +2,11 @@
class Notification < ActiveRecord::Base
serialize :params
has_many :localized_notifications, :class_name => 'Notifiable::LocalizedNotification', :dependent => :destroy
- accepts_nested_attributes_for :localized_notifications
+ accepts_nested_attributes_for :localized_notifications, reject_if: proc { |attributes| attributes['message'].blank? }
belongs_to :app, :class_name => 'Notifiable::App'
validates :app, presence: true
def notification_statuses
@@ -38,13 +38,9 @@
self.app.configure(provider, notifier)
@notifiers[provider] = notifier
end
notifiers[provider].send_notification(d) if d.is_valid?
- end
-
- def send_params
- @send_params ||= (self.params ? self.params : {}).merge({:notification_id => self.id})
end
private
def notifiers
@notifiers ||= {}
\ No newline at end of file