diff --git a/CHANGELOG.md b/CHANGELOG.md index 095d2de7b..34c0d1234 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Enforced validation on required input fields - Fix a bug: the view is not refreshed when deleting a recurring slot - Fix a bug: unable to add a new authorized file type for project's CAD files +- Fix a bug: unable to update a coupon ## v4.7.6 2021 March 24 - Ability to disable the trainings module diff --git a/app/models/coupon.rb b/app/models/coupon.rb index 04650e924..36afc2594 100644 --- a/app/models/coupon.rb +++ b/app/models/coupon.rb @@ -5,7 +5,7 @@ class Coupon < ApplicationRecord has_many :invoices has_many :payment_schedule - after_save :create_stripe_coupon, on: [:create] + after_create :create_stripe_coupon after_commit :delete_stripe_coupon, on: [:destroy] validates :name, presence: true