Class: Reform::Form::Validate::Changed

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

Instance Method Summary collapse

Instance Method Details

#call(fragment, params, options) ⇒ Object



60
61
62
63
64
65
66
67
68
# File 'lib/reform/form/validate.rb', line 60

def call(fragment, params, options)
  # options is a Representable::Options object holding all the stakeholders. this is here becaues of pass_options: true.
  form = options.represented
  name = options.binding.name

  form.changed[name] = form.send(name) != fragment

  fragment
end