-je obtenir l'avertissement suivant deprecation:Exemple d'avertissement deprecation
DEPRECATION WARNING: The behavior of `changed?`
inside of after callbacks will be changing
in the next version of Rails.
The new return value will reflect the behavior
of calling the method after `save` returned
(e.g. the opposite of what it returns now).
To maintain the current behavior, use `saved_changes?` instead.
pour ce code:
def send_devise_notification(notification, *args)
# If the record is new or changed then delay the
# delivery until the after_commit callback otherwise
# send now because after_commit will not be called.
if new_record? || changed?
pending_notifications << [notification, args]
else
devise_mailer.send(notification, self, *args).deliver_later
end
end
Quelqu'un peut me expliquer l'avertissement de Obsolescence un exemple? Je ne sais pas si je comprends bien ce que est censé avec The new return value will reflect the behavior of calling the method after "save" returned
Puis-je remplacer maintenant simplement changed?
avec saved_changes?
? Merci