Module: ActiveModel::Validations::Reflection
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/active_model/validations/reflection.rb
Defined Under Namespace
Modules: ClassMethods, Helpers
Instance Method Summary
collapse
Instance Method Details
#relevant_validators(*kinds) ⇒ Object
62
63
64
65
66
67
68
|
# File 'lib/active_model/validations/reflection.rb', line 62
def relevant_validators(*kinds)
self.class.validators_of_kinds(*kinds).select do |validator|
next true if Helpers.flat_validator?(validator)
Helpers.relevant_validator?(validator, self)
end
end
|
#relevant_validators_on(attribute, *kinds) ⇒ Object
70
71
72
73
74
75
76
|
# File 'lib/active_model/validations/reflection.rb', line 70
def relevant_validators_on(attribute, *kinds)
self.class.validators_on_of_kinds(attribute, *kinds).select do |validator|
next true if Helpers.flat_validator?(validator)
Helpers.relevant_validator?(validator, self)
end
end
|