2021-02-02 21:04:53 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
|
|
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
|
|
|
class TransactionAssignment < ApplicationRecord
|
|
|
|
include Model::Houidable
|
|
|
|
setup_houid :trxassign
|
|
|
|
|
2021-04-07 21:43:58 +00:00
|
|
|
delegated_type :assignable, types: ['ModernDonation', 'CampaignGiftPurchase', 'TicketPurchase']
|
|
|
|
|
|
|
|
delegate :to_id,
|
|
|
|
:to_builder,
|
|
|
|
:publish_created,
|
|
|
|
:publish_updated,
|
|
|
|
:publish_deleted, to: :assignable
|
|
|
|
|
2021-02-02 21:04:53 +00:00
|
|
|
belongs_to :trx, class_name: 'Transaction', foreign_key: "transaction_id"
|
2021-04-07 21:43:58 +00:00
|
|
|
has_one :supporter, through: :trx
|
|
|
|
has_one :nonprofit, through: :trx
|
2021-02-02 21:04:53 +00:00
|
|
|
|
|
|
|
end
|