Class: Slayer::Form

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/slayer/form.rb

Instance Method Summary collapse

Instance Method Details

#validate!Object

Raises:

  • (NotImplementedError)

8
9
10
11
12
13
# File 'lib/slayer/form.rb', line 8

def validate!
  validatable = respond_to?(:valid?) && respond_to?(:errors)

  raise NotImplementedError unless validatable
  raise FormValidationError, errors unless valid?
end