Fixed error in group_serializer if no current_user defined
• Fixed: - error in group_serializer if no current_user defined
This commit is contained in:
parent
91a62bb3b5
commit
20ef23659c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user