Module: Gecko::Helpers::ValidationHelper
- Included in:
- Record::Base
- Defined in:
- lib/gecko/helpers/validation_helper.rb
Overview
Provides record validation
Instance Method Summary collapse
-
#errors ⇒ Gecko::Errors
Returns the validation errors object for the record.
-
#valid? ⇒ Boolean
Returns whether a record is considered valid or not.
Instance Method Details
#errors ⇒ Gecko::Errors
Returns the validation errors object for the record
19 20 21 |
# File 'lib/gecko/helpers/validation_helper.rb', line 19 def errors @errors ||= Gecko::Errors.new(self) end |
#valid? ⇒ Boolean
Returns whether a record is considered valid or not
10 11 12 |
# File 'lib/gecko/helpers/validation_helper.rb', line 10 def valid? errors.empty? end |