mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Move class definition inside migration
This commit is contained in:
committed by
Rachel Arnould
parent
bd48a982fb
commit
ffe3f12a23
@@ -1,4 +1,9 @@
|
||||
class SetConnectedAppsEnabledIfAny < ActiveRecord::Migration[7.0]
|
||||
class ConnectedApp < ApplicationRecord
|
||||
scope :discover_regen, -> { where(type: "ConnectedApp") }
|
||||
scope :affiliate_sales_data, -> { where(type: "ConnectedApps::AffiliateSalesData") }
|
||||
end
|
||||
|
||||
def up
|
||||
enabled = []
|
||||
enabled << "discover_regen" if ConnectedApp.discover_regen.any?
|
||||
@@ -7,8 +12,3 @@ class SetConnectedAppsEnabledIfAny < ActiveRecord::Migration[7.0]
|
||||
Spree::Config.connected_apps_enabled = enabled.presence&.join(",")
|
||||
end
|
||||
end
|
||||
|
||||
class ConnectedApp < ApplicationRecord
|
||||
scope :discover_regen, -> { where(type: "ConnectedApp") }
|
||||
scope :affiliate_sales_data, -> { where(type: "ConnectedApps::AffiliateSalesData") }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user