diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index c66c874dc..9be96f559 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -57,7 +57,7 @@ class TagsController < ApplicationController ) )).select('DISTINCT posts.*') else - @posts = StatusMessage.where(:public => true, :pending => false) + @posts = StatusMessage.all_public end @posts = @posts.tagged_with(params[:name]) diff --git a/app/models/post.rb b/app/models/post.rb index b0e201314..6a04e685f 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -31,6 +31,8 @@ class Post < ActiveRecord::Base validates :guid, :uniqueness => true + scope :all_public, where(:public => true, :pending => false) + def diaspora_handle read_attribute(:diaspora_handle) || self.author.diaspora_handle end