Skip to content
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

Merged
merged 6 commits into from Mar 23, 2012

Conversation

rthbound
Copy link

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

@@ -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 }
Copy link
Contributor

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

@sferik
Copy link
Member

sferik commented Mar 23, 2012

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

sferik added a commit that referenced this pull request Mar 23, 2012
@sferik sferik merged commit 6496d0e into rubygems:master Mar 23, 2012
@sferik
Copy link
Member

sferik commented Mar 23, 2012

Hmmm, it looks like this broke this tests: http://travis-ci.org/rubygems/rubygems.org/builds/934871

Reverting...

sferik added a commit that referenced this pull request Mar 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants