all_public scope in Post for clarity
This commit is contained in:
parent
4b0c45d895
commit
293afd80ff
2 changed files with 3 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ class TagsController < ApplicationController
|
||||||
)
|
)
|
||||||
)).select('DISTINCT posts.*')
|
)).select('DISTINCT posts.*')
|
||||||
else
|
else
|
||||||
@posts = StatusMessage.where(:public => true, :pending => false)
|
@posts = StatusMessage.all_public
|
||||||
end
|
end
|
||||||
|
|
||||||
@posts = @posts.tagged_with(params[:name])
|
@posts = @posts.tagged_with(params[:name])
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ class Post < ActiveRecord::Base
|
||||||
|
|
||||||
validates :guid, :uniqueness => true
|
validates :guid, :uniqueness => true
|
||||||
|
|
||||||
|
scope :all_public, where(:public => true, :pending => false)
|
||||||
|
|
||||||
def diaspora_handle
|
def diaspora_handle
|
||||||
read_attribute(:diaspora_handle) || self.author.diaspora_handle
|
read_attribute(:diaspora_handle) || self.author.diaspora_handle
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue