fix bug with unprepared statements to sql in Rails 4
Merge pull request #367 from rsl/master

Fixed bug with Rails 4 and association#to_sql