This project is archived and is in readonly mode.
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
-
Repository December 20th, 2008 @ 09:09 PM
- State changed from new to resolved
- Tag changed from activerecord, association, has_many_through to activerecord, association, has_many_through, patch
(from [75a133f92ff7e27b83032babf829d8a58803bb3c]) Fix has many through not quoting table names [#1163 state:resolved]
Signed-off-by: Frederick Cheung frederick.cheung@gmail.com http://github.com/rails/rails/co...
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
- 1163 Rails 2.1 : Has Many Through Association INNER JOIN Sql Table name is not quoted (from [75a133f92ff7e27b83032babf829d8a58803bb3c]) Fix has...
- 425 inner join error in has_many :through Issue fixed in #1163/ 75a133f92ff7e27b83032babf829d8a588...