Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#1163

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.

Reported by Karthik Krishnan · October 3rd, 2008 @ 12:49 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Repository
    Repository
    • 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 Rails 2.1 : Has Many Through Association INNER JOIN Sql Table name is not quoted state:resolved]

    Signed-off-by: Frederick Cheung frederick.cheung@gmail.com http://github.com/rails/rails/co...

    December 20th, 2008 @ 09:09 PM