0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

Add asset requiring for backwards compatibility

Dieser Commit ist enthalten in:
Angus McLeod 2022-09-23 16:23:41 +02:00
Ursprung 8083f44389
Commit 26749bd055

Datei anzeigen

@ -135,7 +135,20 @@ class CustomWizard::Field
@acbs ||= [] @acbs ||= []
end end
def self.register(type, plugin = nil, opts = {}) def self.require_assets
Rails.logger.warn("Custom Wizard field regisration no longer requires asset registration. Support will be removed in v2.1.0.")
@require_assets ||= {}
end
def self.register(type, plugin = nil, opts = {}, legacy_opts = {})
if opts.is_a?(Array)
Rails.logger.warn("Custom Wizard field regisration no longer requires asset registration. Support will be removed in v2.1.0.")
require_assets[plugin] = opts
opts = legacy_opts
end
if type if type
types[type.to_sym] ||= {} types[type.to_sym] ||= {}
types[type.to_sym] = opts[:type_opts] if opts[:type_opts].present? types[type.to_sym] = opts[:type_opts] if opts[:type_opts].present?