Skip to content

Commit

Permalink
should delete cache instead of write empty hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac Williams committed Nov 9, 2010
1 parent a3e1519 commit c4c9a1d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/models/calculator/active_shipping.rb
Expand Up @@ -56,9 +56,8 @@ def retrieve_rates(origin, destination, packages)
message = re.message
end

Rails.cache.write @cache_key, {} #write empty hash to cache to prevent constant re-lookups

raise Spree::ShippingError.new("#{I18n.t('shipping_error')}: #{message}")
Rails.cache.delete @cache_key # delete cache to prevent constant re-lookups
raise Spree::ShippingError, "#{I18n.t('shipping_error')}: #{message}"
end
end

Expand Down

0 comments on commit c4c9a1d

Please sign in to comment.