Preserve user supplied JOIN order.

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

Fixes #12953, #15488.
Merge pull request #1 from thedarkone/join-order-fix

Preserve user supplied JOIN order.