mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-09 03:20:21 +00:00
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:
@@ -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?
|
||||
|
||||
11
app/models/connected_apps/affiliate_sales_data.rb
Normal file
11
app/models/connected_apps/affiliate_sales_data.rb
Normal 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
|
||||
Reference in New Issue
Block a user