Skip to content

Commit

Permalink
Update program type before save is committed
Browse files Browse the repository at this point in the history
`after_save :update_program_type!` sets the program type after the record has been saved to the database. This doesn't update the database record unless it is saved again.
  • Loading branch information
Nitemaeric committed Nov 22, 2024
1 parent a2f5e70 commit d89e977
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Course < ApplicationRecord
after_validation :remove_unnecessary_enrichments_validation_message
before_save :set_applications_open_from

after_save :update_program_type!, if: :saved_change_to_funding?
before_save :update_program_type!, if: :will_save_change_to_funding?

belongs_to :provider

Expand Down

0 comments on commit d89e977

Please sign in to comment.