Skip to content
Browse files

Fixing a "stack level too deep" error on 64-bit Ruby, by using write_…

…attribute instead of recursively calling the setter.
  • Loading branch information...
1 parent 785f609 commit d17d7a1b70b7a0899a1485f91b93c12cd4828a7e Bèr Kessels committed Apr 13, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 app/models/spree/variant_decorator.rb
4 app/models/spree/variant_decorator.rb
@@ -1,8 +1,6 @@
Spree::Variant.class_eval do
- alias_method :old_price=, :price=
def price=(value)
- self.old_price = SpreeLocalize.normalize_number(value)
+ write_attribute(:price, SpreeLocalize.normalize_number(value))
[:cost_price, :weight, :height, :width, :depth].each do |attribute|

0 comments on commit d17d7a1

Please sign in to comment.
Something went wrong with that request. Please try again.