diff --git a/app/relations/extension.rb b/app/relations/extension.rb index 8972f015..9e03151b 100644 --- a/app/relations/extension.rb +++ b/app/relations/extension.rb @@ -10,6 +10,7 @@ module Terminus has_many :devices, through: :extension_device, relation: :device, as: :devices has_many :extension_models, relation: :extension_model has_many :models, through: :extension_model, relation: :model, as: :models + has_many :extension_exchanges, relation: :extension_exchange end end end diff --git a/app/relations/extension_exchange.rb b/app/relations/extension_exchange.rb new file mode 100644 index 00000000..b33eea34 --- /dev/null +++ b/app/relations/extension_exchange.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Terminus + module Relations + # The extension exchange relation. + class ExtensionExchange < DB::Relation + schema :extension_exchange, infer: true do + associations { belongs_to :extension, relation: :extension } + end + end + end +end