Use new changed? Rails method
`attribute_changed?` inside of after callbacks has changed his behaviour. The new return value will reflect the behavior of calling the method after `save` returned. To maintain the current behavior, I have `saved_change_to_attribute?` instead.
This commit is contained in:
parent
085e33f495
commit
014ff1acc3
3 changed files with 6 additions and 6 deletions
|
|
@ -37,7 +37,7 @@ class Venue < ApplicationRecord
|
|||
def notify_on_venue_changed?
|
||||
return false unless conference.try(:email_settings).try(:send_on_venue_updated)
|
||||
# do not notify unless the address changed
|
||||
return false unless name_changed? || street_changed? || city_changed? || country_changed?
|
||||
return false unless saved_change_to_name? || saved_change_to_street? || saved_change_to_city? || saved_change_to_country?
|
||||
|
||||
# do not notify unless the mail content is set up
|
||||
(!conference.email_settings.venue_updated_subject.blank? && !conference.email_settings.venue_updated_body.blank?)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue