mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 07:01:58 +08:00
19 lines
405 B
Ruby
19 lines
405 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Settings < ApplicationRecord
|
|
def self.instance
|
|
first || new
|
|
end
|
|
|
|
def values
|
|
merged_values = super
|
|
self.class.instance_methods(false).grep(/^load_values_from_[A-Z0-9_]*/).each do |method|
|
|
merged_values = merged_values.merge(public_send(method))
|
|
end
|
|
merged_values
|
|
end
|
|
|
|
def load_values_from_env
|
|
raise NotImplementedError
|
|
end
|
|
end
|