Commit 20ef2365 authored by mgabdev's avatar mgabdev

Fixed error in group_serializer if no current_user defined

• Fixed:
- error in group_serializer if no current_user defined
parent 91a62bb3
......@@ -16,7 +16,7 @@ class REST::GroupSerializer < ActiveModel::Serializer
end
def password
if current_user && object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
if defined?(current_user) && object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
object.password
else
nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment