mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
(bug) unable to get latest payment_gateway_object for plan/machine/training/space
This commit is contained in:
parent
37989aec63
commit
30daed11fd
@ -2,6 +2,7 @@
|
||||
|
||||
- OpenAPI endpoint to fetch subscription data
|
||||
- Fix a bug: invalid date display in negative timezones
|
||||
- Fix a bug: unable to get latest payment_gateway_object for plan/machine/training/space
|
||||
|
||||
## v5.6.10 2023 February 02
|
||||
|
||||
|
@ -29,7 +29,7 @@ class Machine < ApplicationRecord
|
||||
has_many :credits, as: :creditable, dependent: :destroy
|
||||
has_many :plans, through: :credits
|
||||
|
||||
has_one :payment_gateway_object, as: :item, dependent: :destroy
|
||||
has_one :payment_gateway_object, -> { order id: :desc }, inverse_of: :machine, as: :item, dependent: :destroy
|
||||
|
||||
has_many :machines_products, dependent: :destroy
|
||||
has_many :products, through: :machines_products
|
||||
|
@ -13,7 +13,7 @@ class Plan < ApplicationRecord
|
||||
has_many :subscriptions, dependent: :nullify
|
||||
has_one :plan_file, as: :viewable, dependent: :destroy
|
||||
has_many :prices, dependent: :destroy
|
||||
has_one :payment_gateway_object, as: :item, dependent: :destroy
|
||||
has_one :payment_gateway_object, -> { order id: :desc }, inverse_of: :plan, as: :item, dependent: :destroy
|
||||
|
||||
extend FriendlyId
|
||||
friendly_id :base_name, use: :slugged
|
||||
|
@ -26,7 +26,7 @@ class Space < ApplicationRecord
|
||||
has_many :prepaid_packs, as: :priceable, dependent: :destroy
|
||||
has_many :credits, as: :creditable, dependent: :destroy
|
||||
|
||||
has_one :payment_gateway_object, as: :item, dependent: :destroy
|
||||
has_one :payment_gateway_object, -> { order id: :desc }, inverse_of: :space, as: :item, dependent: :destroy
|
||||
|
||||
has_one :advanced_accounting, as: :accountable, dependent: :destroy
|
||||
accepts_nested_attributes_for :advanced_accounting, allow_destroy: true
|
||||
|
@ -27,7 +27,7 @@ class Training < ApplicationRecord
|
||||
has_many :credits, as: :creditable, dependent: :destroy
|
||||
has_many :plans, through: :credits
|
||||
|
||||
has_one :payment_gateway_object, as: :item, dependent: :destroy
|
||||
has_one :payment_gateway_object, -> { order id: :desc }, inverse_of: :training, as: :item, dependent: :destroy
|
||||
|
||||
has_one :advanced_accounting, as: :accountable, dependent: :destroy
|
||||
accepts_nested_attributes_for :advanced_accounting, allow_destroy: true
|
||||
|
Loading…
Reference in New Issue
Block a user