rails/rails — Issue #3594: RecordInvalid error thrown when adding an invalid association with "object_ids = [ids]" 
Author: joeytheman
Created: 2011-11-10 10:05:40+00:00
State: open

When adding an association using `_ids = [association_ids]` for a has_many through relationship, ActiveRecord throws a
RecordInvalid error if one of the association_id records does not validate. When used with a nested form, the update action
will not render the edit action when `object.update_attributes` fails.

Repo to reproduce bug
https://joeytheman@github.com/joeytheman/Rails-3.1.1-_ids-bug.git

Setup:
1. Install the bundled gems and rake the database
2. Run `Classroom.setup_data` in the console to add the default data

Reproduce In Console:
1. Run `Classroom.add_invalid_teacher_to_classroom`

Reproduce In Browser:
1. Navigate to `/classrooms/1/edit`
2. Check the Teachers box for ` Teacher ids 2`
3. Click `Update Classroom`

Simple Form is used as a convenience to create the check box fields.