Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should #save also save nested/associated model objects? #73

Closed

Commits on Mar 19, 2014

  1. Since we were ignoring the errors generated by calling validate anywa…

    …y (:created_at => ["can't be
    
    blank"]), just call from_hash directly, to make it clearer that we're not interested in any side
    effects from calling validate.
    TylerRick committed Mar 19, 2014
    Configuration menu
    Copy the full SHA
    e736513 View commit details
    Browse the repository at this point in the history
  2. Added a reminder to remove #save override now that Reform::Form::Acti…

    …veRecord automatically saves
    
    the model object now.
    TylerRick committed Mar 19, 2014
    Configuration menu
    Copy the full SHA
    461f87d View commit details
    Browse the repository at this point in the history
  3. Add a failing test that shows that Form#save does not automatically s…

    …ave associated objects.
    
    (Though if the main object has autosave: true on any associations, those would automatically get
    saved when the main object is saved.)
    TylerRick committed Mar 19, 2014
    Configuration menu
    Copy the full SHA
    4925b29 View commit details
    Browse the repository at this point in the history
  4. Call save on all associated/nested models/subforms in Reform::Form::A…

    …ctiveRecord#save, in addition
    
    to calling model.save on the "main model".  This should recursively make sure model.save gets called
    on all nested model objects (as long as those nested forms also include Reform::Form::ActiveRecord).
    TylerRick committed Mar 19, 2014
    Configuration menu
    Copy the full SHA
    0bbd876 View commit details
    Browse the repository at this point in the history