Skip to content

Commit

Permalink
Preserve volume price order.
Browse files Browse the repository at this point in the history
  • Loading branch information
schof committed Nov 19, 2008
1 parent 9bcf784 commit c123cbb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/volume_price.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class VolumePrice < ActiveRecord::Base
belongs_to :variant
acts_as_list :scope => :variant
validates_presence_of :variant

OPEN_ENDED = /\([0-9]+\+\)/
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20081119145604_create_volume_prices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def self.up
t.string :display
t.string :range
t.decimal :amount, :precision => 8, :scale => 2
t.integer :position
t.timestamps
end
end
Expand Down
2 changes: 1 addition & 1 deletion volume_pricing_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class VolumePricingExtension < Spree::Extension

def activate
Variant.class_eval do
has_many :volume_prices
has_many :volume_prices, :order => :position
end

Order.class_eval do
Expand Down

0 comments on commit c123cbb

Please sign in to comment.