Class: Reform::Form::Populator::Sync

Inherits:
Reform::Form::Populator show all
Defined in:
lib/reform/form/populator.rb

Overview

Sync (default) blindly grabs the corresponding form twin and returns it. This might imply that nil is returned, and in turn #validate! is called on nil.

Instance Method Summary collapse

Methods inherited from Reform::Form::Populator

#call, #initialize

Constructor Details

This class inherits a constructor from Reform::Form::Populator

Instance Method Details

#call!(options) ⇒ Object



100
101
102
103
104
105
106
# File 'lib/reform/form/populator.rb', line 100

def call!(options)
  if options[:binding].array?
    return options[:model][options[:index]]
  else
    options[:model]
  end
end