Module: ACH::Validations
- Included in:
- Component, Record::Base
- Defined in:
- lib/ach/validations.rb
Overview
This module hosts the most basic validations for both components and records. The only validation being performed is presence validation.
Instance Method Summary collapse
-
#errors ⇒ ActiveSupport::OrderedHash
Return
errorshash. -
#valid? ⇒ Boolean
Clear errors, validate object and return
trueif records are empty.
Instance Method Details
#errors ⇒ ActiveSupport::OrderedHash
Return errors hash.
40 41 42 |
# File 'lib/ach/validations.rb', line 40 def errors @errors || reset_errors! end |
#valid? ⇒ Boolean
Clear errors, validate object and return true if records are empty.
8 9 10 11 12 |
# File 'lib/ach/validations.rb', line 8 def valid? reset_errors! is_a?(Component) ? validate_as_component : validate_as_record errors.empty? end |