Module: ValidAttribute
- Extended by:
- ActiveSupport::Concern
- Included in:
- Project
- Defined in:
- app/models/concerns/valid_attribute.rb
Instance Method Summary collapse
-
#valid_attribute?(attribute) ⇒ Boolean
Checks whether an attribute has failed validation or not.
Instance Method Details
#valid_attribute?(attribute) ⇒ Boolean
Checks whether an attribute has failed validation or not
attribute
The symbolised name of the attribute i.e :name
9 10 11 |
# File 'app/models/concerns/valid_attribute.rb', line 9 def valid_attribute?(attribute) self.errors.empty? || self.errors.[attribute].nil? end |