lib/notification_settings/target.rb in notification-settings-1.2.0 vs lib/notification_settings/target.rb in notification-settings-1.2.1

- old
+ new

@@ -5,20 +5,20 @@ extend ActiveSupport::Concern included do has_one :notification_setting, as: :object, class_name: 'NotificationSettings::Setting', dependent: :destroy - after_create_commit :create_notification_setting + before_create :create_notification_setting include NotificationSettings::Target::InstanceMethods end module InstanceMethods private def create_notification_setting - self.notification_setting.create! + self.build_notification_setting end end end