New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No duplication in just updated #389
No duplication in just updated #389
Conversation
…h versions. Return only the latest version.
…sive just_updated test
@@ -54,6 +54,10 @@ def self.latest(limit=5) | |||
with_one_version.order("created_at desc").limit(limit) | |||
end | |||
|
|||
def self.just_updated(limit=5) | |||
with_versions.order("updated_at desc").limit(limit).map { |rg| rg.versions.last } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'm not sure I like the implementation of this. The rubygem model should not have a finder class method which returns instances of Version. Also, I don't believe this will scale well or work correctly with gems with a large amount of versions (full table join, limit applied to the joined gems with versions, not to the unique count of gems).
Looking like this is just a few new tests now. Merging... |
Hmmm, it looks like this broke this tests: http://travis-ci.org/rubygems/rubygems.org/builds/934871 Reverting... |
Get the most recent updates through Rubygem model rather than through Version. Eliminate duplication.