Move class definition inside migration

This commit is contained in:
David Cook
2024-08-06 12:03:45 +10:00
committed by Rachel Arnould
parent bd48a982fb
commit ffe3f12a23

View File

@@ -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