mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
25 lines
448 B
Ruby
25 lines
448 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
|
|
|
|
def domain_general
|
|
find_by(code: 'domain_general')
|
|
end
|
|
end
|
|
end
|