rails/rails — pull request #14339 by m-Peter (2014-03-10 10:23:20+00:00)
Title: Enhance readability of NestedAttributes and its test suite

The following assignment and condition checking in one go does not
communicate its intent immediately:

if reflection = reflect_on_association(association_name)

and thus it is splitted.

Some tests state that a new record should not be built when the
:reject_if proc evaluates to false and vice versa. That's not the
case though, because a new record will be rejected if the respective
proc evaluates to true.

Besides its main purpose, a test suite can provide a general outline
of what to expect when we look directly at the implementation so
I've added a few tests to help achieve this.