Module: Reform::Form::Sync
Overview
#sync!
1. assign scalars to model (respecting virtual, excluded attributes)
2. call sync! on nested
Defined Under Namespace
Modules: SkipUnchanged, SyncHash, Writeable
Instance Method Summary collapse
-
#sync!(options) ⇒ Object
reading from fields allows using readers in form for presentation and writers still pass to fields in #validate????.
- #sync_models(options = {}) ⇒ Object (also: #sync)
Methods included from Writeable
Methods included from SyncHash
Instance Method Details
#sync!(options) ⇒ Object
reading from fields allows using readers in form for presentation and writers still pass to fields in #validate????
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/reform/form/sync.rb', line 12 def sync!() # semi-public. = Reform::Representer::Options[.merge(:form => self)] # options local for this form, only. input = sync_hash() # if aliased_model was a proper Twin, we could do changed? stuff there. .delete(:exclude) # TODO: can we use 2 options? dynamic_sync_representer.new(aliased_model).from_hash(input, ) # sync properties to Song. model end |
#sync_models(options = {}) ⇒ Object Also known as: sync
5 6 7 |
# File 'lib/reform/form/sync.rb', line 5 def sync_models(={}) sync!() end |