mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 05:05:55 +08:00
16 lines
313 B
Ruby
16 lines
313 B
Ruby
# frozen_string_literal: true
|
|
|
|
module SettingsModel
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
serialize :settings, JsonbHashSerializer
|
|
after_initialize :init_default_settings, if: :new_record?
|
|
end
|
|
|
|
protected
|
|
|
|
def init_default_settings
|
|
self.settings = self.class::DEFAULT_SETTINGS
|
|
end
|
|
end
|