mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Fix some CC issues
This commit is contained in:
parent
a703c312a0
commit
b7f03dfa69
3 changed files with 31 additions and 13 deletions
|
@ -23,11 +23,12 @@ class SettingEntry < ApplicationRecord
|
|||
SettingEntry.order(id: :asc).where(group: group_name)
|
||||
end
|
||||
|
||||
# rubocop:disable Style/MethodMissingSuper
|
||||
def self.method_missing(method, *args)
|
||||
super(method, *args)
|
||||
rescue NoMethodError
|
||||
if method.to_s[-1] == "="
|
||||
stg_code = method.to_s.sub("=", "")
|
||||
if method.to_s[-1] == '='
|
||||
stg_code = method.to_s.sub('=', '')
|
||||
stg_value = args[0].to_s
|
||||
SettingEntry.find_by!(code: stg_code).update(value: stg_value)
|
||||
else
|
||||
|
@ -35,6 +36,7 @@ class SettingEntry < ApplicationRecord
|
|||
stg ? stg.retrieve : nil
|
||||
end
|
||||
end
|
||||
# rubocop:enable Style/MethodMissingSuper
|
||||
|
||||
# Validators
|
||||
def valid_value_format
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue