|
@ -11,7 +11,7 @@ module Settings |
|
|
@object = object |
|
|
@object = object |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
# rubocop:disable Style/MethodMissing |
|
|
|
|
|
|
|
|
# rubocop:disable Style/MethodMissingSuper |
|
|
def method_missing(method, *args) |
|
|
def method_missing(method, *args) |
|
|
method_name = method.to_s |
|
|
method_name = method.to_s |
|
|
# set a value for a variable |
|
|
# set a value for a variable |
|
@ -24,7 +24,7 @@ module Settings |
|
|
self[method_name] |
|
|
self[method_name] |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
# rubocop:enable Style/MethodMissing |
|
|
|
|
|
|
|
|
# rubocop:enable Style/MethodMissingSuper |
|
|
|
|
|
|
|
|
def respond_to_missing?(*) |
|
|
def respond_to_missing?(*) |
|
|
true |
|
|
true |
|
@ -48,7 +48,6 @@ module Settings |
|
|
record.update!(value: value) |
|
|
record.update!(value: value) |
|
|
|
|
|
|
|
|
Rails.cache.write(Setting.cache_key(key, @object), value) |
|
|
Rails.cache.write(Setting.cache_key(key, @object), value) |
|
|
value |
|
|
|
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def [](key) |
|
|
def [](key) |
|
|