summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2018-04-05 12:28:49 -0300
committerFelipe Artur <felipefac@gmail.com>2018-04-05 14:58:49 -0300
commit62574be35d5a92c6c825912e1ab9969c5acdb7d9 (patch)
tree7ae7e6fa40e51a88a8e5e5d543caa59d7632d2b9 /app
parent22423d284704c3ec2f7715736a75155d14ff413d (diff)
downloadgitlab-ce-62574be35d5a92c6c825912e1ab9969c5acdb7d9.tar.gz
Fix specs
Diffstat (limited to 'app')
-rw-r--r--app/models/milestone.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index dafae58d121..a66a0015827 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -34,8 +34,8 @@ class Milestone < ActiveRecord::Base
scope :for_projects_and_groups, -> (project_ids, group_ids) do
conditions = []
- conditions << arel_table[:project_id].in(project_ids) if project_ids.compact.any?
- conditions << arel_table[:group_id].in(group_ids) if group_ids.compact.any?
+ conditions << arel_table[:project_id].in(project_ids) if project_ids&.compact&.any?
+ conditions << arel_table[:group_id].in(group_ids) if group_ids&.compact&.any?
where(conditions.reduce(:or))
end