Module: ROM::Model::Validator::ClassMethods
- Defined in:
- lib/rom/rails/model/validator.rb
Instance Method Summary collapse
-
#call(attributes) ⇒ Model::Attributes
Trigger validation for specific attributes.
-
#model_name ⇒ Object
FIXME: this looks like not needed.
-
#relation(name = nil) ⇒ Symbol
Set relation name for a validator.
Instance Method Details
#call(attributes) ⇒ Model::Attributes
Trigger validation for specific attributes
114 115 116 117 |
# File 'lib/rom/rails/model/validator.rb', line 114 def call(attributes) validator = new(attributes) validator.call end |
#model_name ⇒ Object
FIXME: this looks like not needed
103 104 105 |
# File 'lib/rom/rails/model/validator.rb', line 103 def model_name attributes.model_name end |
#relation(name = nil) ⇒ Symbol
Set relation name for a validator
This is needed for validators that require database access
97 98 99 100 |
# File 'lib/rom/rails/model/validator.rb', line 97 def relation(name = nil) @relation = name if name @relation end |