all_public scope in Post for clarity

This commit is contained in:
danielgrippi 2011-09-11 19:28:52 -07:00
parent 4b0c45d895
commit 293afd80ff
2 changed files with 3 additions and 1 deletions

View file

@ -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])

View file

@ -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