2017-10-12 20:50:40 +02:00
|
|
|
module CustomFields
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
include RailsSettings::Extend
|
|
|
|
|
|
|
|
attr_accessor :custom_fields
|
|
|
|
|
|
|
|
included do
|
|
|
|
after_initialize do
|
2021-03-01 15:27:26 +01:00
|
|
|
settings.defaults['custom_fields'] = {} unless settings.custom_fields
|
2017-10-12 20:50:40 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
after_save do
|
|
|
|
self.settings.custom_fields = custom_fields if custom_fields
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|