From 3b4a84149b2e277cc3a40627524af394c93046a2 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Thu, 20 Mar 2008 17:24:55 +0000 Subject: [PATCH] ActionItem243: environment has many comments --- app/models/environment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/environment.rb b/app/models/environment.rb index 9a2a1ac..79e8f82 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -212,6 +212,6 @@ class Environment < ActiveRecord::Base end # FIXME is this the better/faster way to do this? - has_many :comments, :finder_sql => 'select comments.* from comments left join articles on articles.id = comments.article_id left join profiles on profiles.id = articles.profile_id where profiles.environment_id = #{id}' + has_many :comments, :through => :articles end -- libgit2 0.21.2