Fix find_visible_post_by_id

This commit is contained in:
danielgrippi 2011-03-29 20:17:19 -07:00
parent 2487db3257
commit 0c8db5beee

View file

@ -7,7 +7,8 @@ module Diaspora
module Querying
def find_visible_post_by_id( id )
self.raw_visible_posts.where(:id => id).includes({:author => :profile}, {:comments => {:author => :profile}}, :photos).first
post = Post.where(:id => id).joins(:contacts).where(:contacts => {:user_id => self.id}).first
post ||= Post.where(:id => id, :author_id => self.person.id).first
end
def raw_visible_posts(opts = {})