Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9d3cc94d
Commit
9d3cc94d
authored
Aug 18, 2021
by
Krasimir Angelov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused HistoricalData.up_until scope
https://gitlab.com/gitlab-org/gitlab/-/issues/334761#note_653511943
parent
6f42db35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
8 deletions
+0
-8
ee/app/models/historical_data.rb
ee/app/models/historical_data.rb
+0
-2
ee/spec/models/historical_data_spec.rb
ee/spec/models/historical_data_spec.rb
+0
-6
No files found.
ee/app/models/historical_data.rb
View file @
9d3cc94d
...
...
@@ -5,8 +5,6 @@ class HistoricalData < ApplicationRecord
# HistoricalData.during((Time.current - 1.year)..Time.current).average(:active_user_count)
scope
:during
,
->
(
range
)
{
where
(
recorded_at:
range
)
}
# HistoricalData.up_until(Time.current - 1.month).average(:active_user_count)
scope
:up_until
,
->
(
timestamp
)
{
where
(
"recorded_at <= :timestamp"
,
timestamp:
timestamp
)
}
class
<<
self
def
track!
...
...
ee/spec/models/historical_data_spec.rb
View file @
9d3cc94d
...
...
@@ -15,12 +15,6 @@ RSpec.describe HistoricalData do
end
end
describe
".up_until"
do
it
"returns the historical data up until the specified date"
do
expect
(
described_class
.
up_until
(
Date
.
new
(
2014
,
6
,
1
)).
average
(
:active_user_count
)).
to
eq
(
350
)
end
end
describe
".track!"
do
before
do
allow
(
User
).
to
receive
(
:billable
).
and_return
([
1
,
2
,
3
,
4
,
5
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment