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