Permalink
Browse files

Whups, eager loading commentables was a snafu

  • Loading branch information...
1 parent 3c1099f commit a0d51aa7328d32445200f4739fb855129406a63b @sudara sudara committed Jan 5, 2009
Showing with 3 additions and 3 deletions.
  1. +2 −2 app/controllers/assets_controller.rb
  2. +1 −1 app/models/comment.rb
View
4 app/controllers/assets_controller.rb
@@ -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?
View
2 app/models/comment.rb
@@ -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, {

0 comments on commit a0d51aa

Please sign in to comment.