No duplication in just updated #389

merged 6 commits into from Mar 23, 2012


None yet

3 participants


Get the most recent updates through Rubygem model rather than through Version. Eliminate duplication.

@cmeiklejohn cmeiklejohn commented on an outdated diff Jan 24, 2012
@@ -54,6 +54,10 @@ def self.latest(limit=5)
with_one_version.order("created_at desc").limit(limit)
+ def self.just_updated(limit=5)
+ with_versions.order("updated_at desc").limit(limit).map { |rg| rg.versions.last }
cmeiklejohn Jan 24, 2012

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).

sferik commented Mar 23, 2012

Looking like this is just a few new tests now. Merging...

@sferik sferik merged commit 6496d0e into rubygems:master Mar 23, 2012
sferik commented Mar 23, 2012

Hmmm, it looks like this broke this tests:


@sferik sferik added a commit that referenced this pull request Mar 23, 2012
@sferik sferik Revert #389 ef74620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment