Skip to content

Commit

Permalink
update subscription.rb change from enabled_change to saved_change_to_…
Browse files Browse the repository at this point in the history
…enabled
  • Loading branch information
yuenmichelle1 committed Oct 22, 2024
1 parent d9d97e2 commit a5f5d3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Subscription < ApplicationRecord
belongs_to :source, polymorphic: true, required: true

before_create :ensure_enabled
after_update :clear_notifications, if: ->{ enabled_change == [true, false] }
after_update :clear_notifications, if: ->{ saved_change_to_enabled == [true, false] }

validates_with SubscriptionUniquenessValidator, on: :create
scope :enabled, ->{ where enabled: true }
Expand Down

0 comments on commit a5f5d3b

Please sign in to comment.