mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
21 lines
378 B
Ruby
21 lines
378 B
Ruby
class SettingGroup < ActiveRecord::Base
|
|
has_many :settings
|
|
|
|
accepts_nested_attributes_for :settings
|
|
|
|
validates :code, uniqueness: true
|
|
|
|
def setting(key)
|
|
settings.find_by(code: key.to_s)
|
|
end
|
|
|
|
class << self
|
|
def domain_validation
|
|
find_by(code: 'domain_validation')
|
|
end
|
|
|
|
def domain_statuses
|
|
find_by(code: 'domain_statuses')
|
|
end
|
|
end
|
|
end
|