This project is archived and is in readonly mode.

#1163 ✓resolved
Karthik Krishnan

Rails 2.1 : Has Many Through Association INNER JOIN Sql Table name is not quoted

Reported by Karthik Krishnan | October 3rd, 2008 @ 12:49 PM | in 2.x

In Rails 2.1, INNER JOIN SQL created for a HasManyThrough Association does not quote the table name. Therefore if the Table Name contains any SQL Keyword, then the SQL error would occur on accessing the association.

I have attached the patch for the same. 1. has_many_through_association.rb - to add quoting of table name. 2. associations.rb - aliased_table_name_for method now should look for quoted table name and not just the table name in the regular expression.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages