Commit 25818ef0 authored by Pavel Shutsin's avatar Pavel Shutsin

Remove obsolete code branch

parent f2876fb0
......@@ -37,26 +37,10 @@ class ProductivityAnalyticsFinder < MergeRequestsFinder
return items unless params[:merged_at_after] || params[:merged_at_before]
items = items.joins(:metrics)
items = items.where(metrics_table[:merged_at].gteq(merged_at_between[:from])) if merged_at_between[:from]
items = items.where(metrics_table[:merged_at].lteq(merged_at_between[:to])) if merged_at_between[:to]
items = items.where(metrics_table[:merged_at].gteq(params[:merged_at_after])) if params[:merged_at_after]
items = items.where(metrics_table[:merged_at].lteq(params[:merged_at_before])) if params[:merged_at_before]
items
end
# rubocop: enable CodeReuse/ActiveRecord
def merged_at_between
@merged_at_between ||= begin
if merged_at_period
{ from: Time.zone.now.ago(merged_at_period.days) }
else
{ from: params[:merged_at_after], to: params[:merged_at_before] }
end
end
end
def merged_at_period
matches = params[:merged_at_after]&.match(/^(?<days>\d+)days?$/)
matches && matches[:days].to_i
end
end
......@@ -62,20 +62,6 @@ describe ProductivityAnalyticsFinder do
end
end
context 'with merged_at_after specified as days-range' do
let(:search_params) do
{
merged_at_after: '11days'
}
end
it 'returns all MRs with merged date later than Xdays ago' do
long_mr
short_mr
expect(subject.execute).to match_array([long_mr])
end
end
context 'with merged_at_after and merged_at_before specified' do
let(:search_params) do
{
......
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