1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-02 13:24:20 +01:00
fab-manager/app/models/payment_schedule_object.rb

13 lines
542 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# Links an object bought and a payment schedule used to pay this object
class PaymentScheduleObject < Footprintable
belongs_to :object, polymorphic: true
2023-02-24 17:26:55 +01:00
belongs_to :reservation, foreign_key: 'object_id', inverse_of: :payment_schedule_object
belongs_to :subscription, foreign_key: 'object_id', inverse_of: :payment_schedule_object
belongs_to :statistic_profile_prepaid_pack, foreign_key: 'object_id', inverse_of: :payment_schedule_object
belongs_to :payment_schedule
after_create :chain_record
end