tags controller fixed

This commit is contained in:
Ilyaaaaaaaaaaaaa Zhitomirskiy 2011-07-05 12:19:41 -07:00
parent 027f096ca7
commit 0ab961e096
2 changed files with 4 additions and 8 deletions

View file

@ -43,8 +43,10 @@ class TagsController < ApplicationController
def show def show
@aspect = :tag @aspect = :tag
if current_user if current_user
@posts = StatusMessage.joins(:contacts).where(:pending => false).where( @posts = StatusMessage.
Contact.arel_table[:user_id].eq(current_user.id).or( joins("LEFT OUTER JOIN post_visibilities ON post_visibilities.post_id = posts.id").
joins("LEFT OUTER JOIN contacts ON contacts.id = post_visibilities.contact_id").
where(Contact.arel_table[:user_id].eq(current_user.id).or(
StatusMessage.arel_table[:public].eq(true).or( StatusMessage.arel_table[:public].eq(true).or(
StatusMessage.arel_table[:author_id].eq(current_user.person.id) StatusMessage.arel_table[:author_id].eq(current_user.person.id)
) )

View file

@ -9,7 +9,6 @@ Feature: posting
And a user with username "alice" And a user with username "alice"
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And a user with username "bob" is connected with "alice"
And I am on the home page And I am on the home page
And I expand the publisher And I expand the publisher
@ -19,11 +18,6 @@ Feature: posting
And I wait for the ajax to finish And I wait for the ajax to finish
And I wait for the ajax to finish And I wait for the ajax to finish
#the following (3 lines) verbosity should not be needed
When I go to the home page
Then I should see "I am da #boss"
And I wait for 5 seconds
And I follow "#boss" And I follow "#boss"
And I wait for the ajax to finish And I wait for the ajax to finish
Then I should see "I am da #boss" Then I should see "I am da #boss"