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
|
|
@ -72,8 +72,8 @@ class Program < ApplicationRecord
|
|||
|
||||
after_create :create_event_types
|
||||
after_create :create_difficulty_levels
|
||||
after_save :unschedule_unfit_events, if: :schedule_interval_changed?
|
||||
after_save :normalize_event_types_length, if: :schedule_interval_changed?
|
||||
after_save :unschedule_unfit_events, if: :saved_change_to_schedule_interval?
|
||||
after_save :normalize_event_types_length, if: :saved_change_to_schedule_interval?
|
||||
validate :check_languages_format
|
||||
|
||||
# Returns all event_schedules for the selected schedule ordered by start_time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue