construct_sql is executed in the initialize method of the association and it handles the substitution of the sql.
Ah, thanks. So the bug is that it doesn't do the right thing if the finder_sql has newlines (the regex needs to be modified). I'll submit a patch.
_______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core