Class: Reform::Form::Validate::Skip::AllBlank

Inherits:
Object
  • Object
show all
Includes:
Uber::Callable
Defined in:
lib/reform/form/validate.rb

Instance Method Summary collapse

Instance Method Details

#call(form, params, options) ⇒ Object



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

def call(form, params, options)
  # TODO: Schema should provide property names as plain list.
  properties = options.binding[:twin].representer_class.representable_attrs[:definitions].keys

  properties.each { |name| params[name].present? and return false }
  true # skip
end