#435: cleanup
This commit is contained in:
parent
f39c9e0bb5
commit
fac4f5638b
|
@ -61,9 +61,11 @@ class Statistic < ActiveRecord::Base
|
|||
FROM relations
|
||||
INNER JOIN projects ON projects.id = relations.target_id
|
||||
WHERE relations.target_type = 'Project' AND
|
||||
relations.actor_type = 'Group' AND relations.actor_id IN (:groups)
|
||||
projects.owner_type = 'Group' AND
|
||||
relations.actor_type = 'Group' AND
|
||||
relations.actor_id IN (:groups)
|
||||
)
|
||||
)", { user: @user, groups: group_ids }
|
||||
)", { groups: group_ids }
|
||||
]) if group_ids.present?
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class StatisticPresenter < ApplicationPresenter
|
|||
end
|
||||
|
||||
def group_ids
|
||||
@group_ids ||= Group.where(uname: users_or_groups).map(&:member_ids).flatten.uniq
|
||||
@group_ids ||= Group.where(uname: users_or_groups).pluck(:id)
|
||||
end
|
||||
|
||||
def scope
|
||||
|
|
Loading…
Reference in New Issue