Commit 96bb3be53f02ca7aa46a6e81e620829d4cc9ff2a

Authored by Rodrigo Souto
1 parent 849d10c7

Improve acts_as_having_posts feed fetch performance

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
lib/acts_as_having_posts.rb
@@ -22,7 +22,7 @@ module ActsAsHavingPosts @@ -22,7 +22,7 @@ module ActsAsHavingPosts
22 end 22 end
23 23
24 def feed 24 def feed
25 - self.children.find(:first, :conditions => {:type => 'RssFeed'}) 25 + Article.where(:parent_id => self.id).where(:type => 'RssFeed').first
26 end 26 end
27 27
28 def feed=(attrs) 28 def feed=(attrs)