Ruby onRails3.2.2とMySQLを使用しています。has_many :through
ActiveRecord::Associations
次のSLQクエリを生成するメソッド(an )があります。
SELECT DISTINCT `articles`.*
FROM `articles`
INNER JOIN `articles_comments_associations` `comment_associations_articles`
ON `comment_associations_articles`.`article_id` = `articles`.`id`
INNER JOIN `articles_comments_associations`
ON `articles`.`id` = `articles_comments_associations`.`article_id`
WHERE `articles_comments_associations`.`comment_id` = 223
AND (articles_comments_associations.user_id IN (2))
それが何を意味するのかINNER JOIN 'articles_comments_associations' 'comment_associations_articles'
(注:には複数のデータベーステーブルステートメントがあります)、およびという名前のデータベーステーブルがないINNER JOIN
ためにSQLクエリがどのように機能する可能性があるのかを理解したいと思います。エラーですか(期待どおりに機能する場合でも)?comment_associations_articles