From 0ab961e09637895d2ceb648511c0ef27339f21d5 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Tue, 5 Jul 2011 12:19:41 -0700 Subject: [PATCH] tags controller fixed --- app/controllers/tags_controller.rb | 6 ++++-- features/follows_tags.feature | 6 ------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 8878460be..fe9e18e1f 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -43,8 +43,10 @@ class TagsController < ApplicationController def show @aspect = :tag if current_user - @posts = StatusMessage.joins(:contacts).where(:pending => false).where( - Contact.arel_table[:user_id].eq(current_user.id).or( + @posts = StatusMessage. + 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[:author_id].eq(current_user.person.id) ) diff --git a/features/follows_tags.feature b/features/follows_tags.feature index ccacb623a..6271ffed2 100644 --- a/features/follows_tags.feature +++ b/features/follows_tags.feature @@ -9,7 +9,6 @@ Feature: posting And a user with username "alice" 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 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 - #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 wait for the ajax to finish Then I should see "I am da #boss"