Updated group_serializer to account for no current_user
• Updated: - group_serializer to account for no current_user
This commit is contained in:
parent
b124a5024c
commit
4242f595df
|
@ -16,7 +16,7 @@ class REST::GroupSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def password
|
def password
|
||||||
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
|
if current_user && object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
|
||||||
object.password
|
object.password
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
|
|
Loading…
Reference in New Issue