2022-11-10 16:14:49 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# AdvancedAccounting enables the various objects to have detailed accounting settings
|
|
|
|
class AdvancedAccounting < ApplicationRecord
|
|
|
|
belongs_to :accountable, polymorphic: true
|
|
|
|
belongs_to :machine, foreign_type: 'Machine', foreign_key: 'accountable_id', inverse_of: :advanced_accounting
|
|
|
|
belongs_to :training, foreign_type: 'Training', foreign_key: 'accountable_id', inverse_of: :advanced_accounting
|
|
|
|
belongs_to :space, foreign_type: 'Space', foreign_key: 'accountable_id', inverse_of: :advanced_accounting
|
2022-11-10 16:22:01 +01:00
|
|
|
belongs_to :event, foreign_type: 'Event', foreign_key: 'accountable_id', inverse_of: :advanced_accounting
|
|
|
|
belongs_to :product, foreign_type: 'Product', foreign_key: 'accountable_id', inverse_of: :advanced_accounting
|
2022-11-10 16:14:49 +01:00
|
|
|
end
|