From 818e9e99fcea39364d17e8dddad7b685b8f6b0fc Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 29 Mar 2021 10:19:06 +0200 Subject: [PATCH] [bug] unable to update a coupon --- CHANGELOG.md | 1 + app/models/coupon.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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