foodsoft/app/models/concerns/custom_fields.rb
Philipp Rothmann fb2b4d8a8a chore: rubocop
chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
2023-06-09 17:35:05 +02:00

16 lines
338 B
Ruby

module CustomFields
extend ActiveSupport::Concern
include RailsSettings::Extend
attr_accessor :custom_fields
included do
after_initialize do
settings.defaults['custom_fields'] = {} unless settings.custom_fields
end
after_save do
settings.custom_fields = custom_fields if custom_fields
end
end
end