2020-11-09 07:50:17 +01:00
|
|
|
module CustomWizardCustomFieldPreloader
|
|
|
|
def preload_custom_fields(objects, fields)
|
|
|
|
if objects.present?
|
|
|
|
@cw_klass = objects.first.class.name.underscore
|
|
|
|
if cw_fields.any?
|
|
|
|
cw_fields.each do |field|
|
|
|
|
fields << field.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
super(objects, fields)
|
|
|
|
end
|
|
|
|
|
|
|
|
def cw_fields
|
2020-11-09 08:48:55 +01:00
|
|
|
CustomWizard::CustomField.list_by(:klass, @cw_klass)
|
2020-11-09 07:50:17 +01:00
|
|
|
end
|
|
|
|
end
|