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
|
2023-05-12 13:01:12 +02:00
|
|
|
settings.custom_fields = custom_fields if custom_fields
|
2017-10-12 20:50:40 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|