rails/rails — pull request #12759 by dmarkow (2013-11-04 19:40:56+00:00)
Title: Backport relation merger updates from 9675c7d to 4-0-stable

At @rafaelfranca's request, this backports commit 9675c7d into the 4-0-stable branch to fix #10995. All tests are passing.

This is the first time I've ever attempted backporting; any feedback is greatly appreciated!