Commit 5e63f450 authored by alinamihaila's avatar alinamihaila

Rename methods using _id

parent f4e24934
......@@ -256,15 +256,15 @@ module EE
projects_imported_from_github: distinct_count(::Project.github_imported.where(time_period), :creator_id),
projects_with_repositories_enabled: distinct_count(::Project.with_repositories_enabled.where(time_period),
:creator_id,
start: user_minimum,
finish: user_maximum),
protected_branches: distinct_count(::Project.with_protected_branches.where(time_period), :creator_id, start: user_minimum, finish: user_maximum),
start: user_minimum_id,
finish: user_maximum_id),
protected_branches: distinct_count(::Project.with_protected_branches.where(time_period), :creator_id, start: user_minimum_id, finish: user_maximum_id),
remote_mirrors: distinct_count(::Project.with_remote_mirrors.where(time_period), :creator_id),
snippets: distinct_count(::Snippet.where(time_period), :author_id),
suggestions: distinct_count(::Note.with_suggestions.where(time_period),
:author_id,
start: user_minimum,
finish: user_maximum)
start: user_minimum_id,
finish: user_maximum_id)
}
end
......@@ -377,8 +377,8 @@ module EE
private
def distinct_count_service_desk_enabled_projects(time_period)
project_creator_id_start = user_minimum
project_creator_id_finish = user_maximum
project_creator_id_start = user_minimum_id
project_creator_id_finish = user_maximum_id
distinct_count(::Project.service_desk_enabled.where(time_period), :creator_id, start: project_creator_id_start, finish: project_creator_id_finish)
end
......
......@@ -438,28 +438,27 @@ module Gitlab
end
end
<<<<<<< HEAD
def default_time_period
{ created_at: 28.days.ago..Time.current }
=======
end
private
def user_minimum
strong_memoize(:user_minimum) do
def user_minimum_id
strong_memoize(:user_minimum_id) do
::User.minimum(:id)
end
end
def user_maximum
strong_memoize(:user_maximum) do
def user_maximum_id
strong_memoize(:user_maximum_id) do
::User.maximum(:id)
end
end
def clear_memoized_limits
clear_memoization(:user_minimum)
clear_memoization(:user_maximum)
>>>>>>> db9759262b7... Take user minimum and maximum one time
clear_memoization(:user_minimum_id)
clear_memoization(:user_maximum_id)
end
end
end
......
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