Commit 3b4a84149b2e277cc3a40627524af394c93046a2
1 parent
f11119cd
Exists in
master
and in
22 other branches
ActionItem243: environment has many comments
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1594 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/environment.rb
@@ -212,6 +212,6 @@ class Environment < ActiveRecord::Base | @@ -212,6 +212,6 @@ class Environment < ActiveRecord::Base | ||
212 | end | 212 | end |
213 | 213 | ||
214 | # FIXME is this the better/faster way to do this? | 214 | # FIXME is this the better/faster way to do this? |
215 | - 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}' | 215 | + has_many :comments, :through => :articles |
216 | 216 | ||
217 | end | 217 | end |