rails/rails — pull request #15461 by thedarkone (2014-06-01 17:13:14+00:00)
Title: Preserve user supplied JOIN order

JOIN clause order is important, previous implementation always put string or arel joins at then end (after auto-generated association joins).

Fixes #12953.

/cc @tenderlove