module Gecko::Helpers::ValidationHelper

Provides record validation

Public Instance Methods

errors() click to toggle source

Returns the validation errors object for the record

@return [Gecko::Errors]

@api public

# File lib/gecko/helpers/validation_helper.rb, line 21
def errors
  @errors ||= Gecko::Errors.new(self)
end
valid?() click to toggle source

Returns whether a record is considered valid or not

@return [Boolean]

@api public

# File lib/gecko/helpers/validation_helper.rb, line 12
def valid?
  errors.empty?
end