Fixed duplicate code that causes additional SQL queries.

This commit is contained in:
Thorsten Eckel 2018-06-29 17:13:51 +02:00
parent 2f5ce86d28
commit e9bbff97a9

View file

@ -133,8 +133,6 @@ module HasGroups
#
# @return [Array<Group>] Groups the instance has the given access(es) to.
def groups_access(access)
return [] if !active?
return [] if !groups_access_permission?
group_ids = group_ids_access(access)
Group.where(id: group_ids)
end