# #sync! # 1. assign scalars to model (respecting virtual, excluded attributes) # 2. call sync! on nested module Reform::Form::Sync def sync_models(options={}) sync!(options) end alias_method :sync, :sync_models # reading from fields allows using readers in form for presentation # and writers still pass to fields in #validate???? def sync!(options) # semi-public. options = Reform::Representer::Options[options.merge(:form => self)] # options local for this form, only. input = sync_hash(options) # if aliased_model was a proper Twin, we could do changed? stuff there. options.delete(:exclude) # TODO: can we use 2 options? dynamic_sync_representer.new(aliased_model).from_hash(input, options) # sync properties to Song. model end private # Transforms form input into what actually gets written to model. # output: {title: "Mint Car", hit: