Add AffiliateSalesData model

Using namespace subfolder to help organise it and show the inheritance.

Hmm, instead of scopes, we could have different has_many relationships on the Enterprise. Maybe it should be in a concern. We can refactor later I guess.
This commit is contained in:
David Cook
2024-07-16 12:34:47 +10:00
parent 27e53f9dcc
commit d3c5e2365a
2 changed files with 12 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ class ConnectedApp < ApplicationRecord
after_destroy :disconnect
scope :discover_regen, -> { where(type: "ConnectedApp") }
scope :affiliate_sales_data, -> { where(type: "ConnectedApps::AffiliateSalesData") }
def connecting?
data.nil?

View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
# An enterprise can opt-in for their data to be included in the affiliate_sales_data endpoint
#
module ConnectedApps
class AffiliateSalesData < ConnectedApp
def connect; end
def disconnect; end
end
end