1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) unable apply a coupon if this coupon has used by an user removed

This commit is contained in:
Du Peng 2022-10-19 11:38:17 +02:00
parent b1d0a5aad2
commit c48956be10
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,7 @@
# Changelog Fab-manager
- Fix a bug: unable apply a coupon if this coupon has used by an user removed
## v5.4.24 2022 October 14
- Fix a bug: unable debit hours of prepaid pack after a reservation of machine

View File

@ -82,7 +82,8 @@ class Coupon < ApplicationRecord
end
def users
invoices.map(&:user)
# compact to user removed
invoices.map(&:user).compact
end
def users_ids
@ -104,5 +105,4 @@ class Coupon < ApplicationRecord
def delete_gateway_coupon
PaymentGatewayService.new.delete_coupon(id)
end
end