mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Dynamic validations example
This commit is contained in:
parent
0c5b7c4cb8
commit
415f109d8f
7 changed files with 75 additions and 48 deletions
|
@ -2,4 +2,11 @@ class SettingGroup < ActiveRecord::Base
|
|||
has_many :settings
|
||||
|
||||
accepts_nested_attributes_for :settings
|
||||
|
||||
DOMAIN_VALIDATION_CODE = 'domain_validation'
|
||||
|
||||
def get(key)
|
||||
s = settings.find_by(code: key.to_s)
|
||||
s.try(:value)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue