1
0
Fork 0

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 ||= []
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
types[type.to_sym] ||= {}
types[type.to_sym] = opts[:type_opts] if opts[:type_opts].present?