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
a861b36d
Commit
a861b36d
authored
Dec 27, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Package.last_of_each_version method
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
e79123fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
ee/app/models/packages/package.rb
ee/app/models/packages/package.rb
+1
-6
No files found.
ee/app/models/packages/package.rb
View file @
a861b36d
...
@@ -34,11 +34,6 @@ class Packages::Package < ActiveRecord::Base
...
@@ -34,11 +34,6 @@ class Packages::Package < ActiveRecord::Base
end
end
def
self
.
last_of_each_version
def
self
.
last_of_each_version
ids
=
self
where
(
id:
all
.
select
(
'MAX(id) AS id'
).
group
(
:version
))
.
select
(
'MAX(id) AS id'
)
.
group
(
:version
)
.
map
(
&
:id
)
where
(
id:
ids
)
end
end
end
end
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