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
21 22 23 |
# File 'lib/gecko/helpers/validation_helper.rb', line 21 def errors @errors ||= Gecko::Errors.new(self) end |
#valid? ⇒ Boolean
Returns whether a record is considered valid or not
12 13 14 |
# File 'lib/gecko/helpers/validation_helper.rb', line 12 def valid? errors.empty? end |