Skip to content

Commit

Permalink
Whups, eager loading commentables was a snafu
Browse files Browse the repository at this point in the history
  • Loading branch information
sudara committed Jan 5, 2009
1 parent 3c1099f commit a0d51aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/assets_controller.rb
Expand Up @@ -74,8 +74,8 @@ def latest
@assets = Asset.latest(@limit)
@favorites = Track.favorites.find(:all, :limit => 5)
@popular = Asset.find(:all, :limit => @limit, :order => 'hotness DESC')
@comments = Comment.public.find(:all, :limit => 5, :order => 'created_at DESC', :include => :commentable) unless admin?
@comments = Comment.include_private.find(:all, :limit => 5, :order => 'created_at DESC', :include => :commentable) if admin?
@comments = Comment.public.find(:all, :limit => 5, :order => 'created_at DESC') unless admin?
@comments = Comment.include_private.find(:all, :limit => 5, :order => 'created_at DESC') if admin?
@playlists = Playlist.public.latest(12)
@tab = 'home'
@welcome = true unless logged_in?
Expand Down
2 changes: 1 addition & 1 deletion app/models/comment.rb
Expand Up @@ -3,7 +3,7 @@ class Comment < ActiveRecord::Base
named_scope :public, {
:conditions => {:spam => false, :private => :false},
:order => 'created_at DESC',
:include => [{:commenter => :pic}, :commentable]
:include => [{:commenter => :pic}]
}

named_scope :include_private, {
Expand Down

0 comments on commit a0d51aa

Please sign in to comment.