Fix find_visible_post_by_id
This commit is contained in:
parent
2487db3257
commit
0c8db5beee
1 changed files with 2 additions and 1 deletions
|
|
@ -7,7 +7,8 @@ module Diaspora
|
||||||
module Querying
|
module Querying
|
||||||
|
|
||||||
def find_visible_post_by_id( id )
|
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
|
end
|
||||||
|
|
||||||
def raw_visible_posts(opts = {})
|
def raw_visible_posts(opts = {})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue