Skip to content

Instantly share code, notes, and snippets.

@nahi
Created September 9, 2009 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nahi/183701 to your computer and use it in GitHub Desktop.
Save nahi/183701 to your computer and use it in GitHub Desktop.
diff --git a/app/models/feed.rb b/app/models/feed.rb
index bbc2719..4a4423a 100644
--- a/app/models/feed.rb
+++ b/app/models/feed.rb
@@ -308,8 +308,8 @@ class Feed
num = opt[:num]
pinned = Pin.find(
:all,
- :conditions => [ 'user_id = ?', auth.id ],
- :joins => 'LEFT OUTER JOIN last_modifieds ON pins.eid = last_modifieds.
eid',
+ :conditions => [ 'pins.eid = last_modifieds.eid AND user_id = ?', auth.
id ],
+ :joins => 'LEFT OUTER JOIN last_modifieds',
:order => 'last_modifieds.date desc',
:offset => start,
:limit => num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment