Reduce array allocations by using a constant
This commit is contained in:
parent
b1445d09b6
commit
9b17b0a553
|
@ -110,11 +110,12 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
PINNABLE_VISIBILITIES = %w(public unlisted).freeze
|
||||||
def pinnable
|
def pinnable
|
||||||
current_user? &&
|
current_user? &&
|
||||||
current_user.account_id == object.account_id &&
|
current_user.account_id == object.account_id &&
|
||||||
!object.reblog? &&
|
!object.reblog? &&
|
||||||
%w(public unlisted).include?(object.visibility)
|
PINNABLE_VISIBILITIES.include?(object.visibility)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pinned_by_group
|
def pinned_by_group
|
||||||
|
|
Loading…
Reference in New Issue