Skip to content

Commit

Permalink
Revert "Version.latest should use the lowest position rather than ass…
Browse files Browse the repository at this point in the history
…uming 0"

This reverts commit cfb7445.
  • Loading branch information
ddollar committed Oct 21, 2009
1 parent cfb7445 commit 3b49153
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/models/version.rb
Expand Up @@ -18,11 +18,10 @@ class Version < ActiveRecord::Base
}

named_scope :with_associated, { :conditions => ["rubygems.versions_count > 1"], :include => :rubygem, :order => "versions.built_at desc" }
named_scope :latest, { :conditions => { :position => 0 }, :include => :rubygem }
named_scope :prerelease, { :conditions => { :prerelease => true }}
named_scope :release, { :conditions => { :prerelease => false }}

named_scope :latest, { :group => 'rubygem_id, platform', :having => 'position = MIN(position)', :include => :rubygem }

before_save :update_prerelease
after_save :reorder_versions

Expand Down

0 comments on commit 3b49153

Please sign in to comment.