Permalink
Browse files

Fixed bug with preference caching

  • Loading branch information...
1 parent 0bba7ff commit a59ae3a8c9bfb4ed31e440655c7d0b6ecfdfb49c @LBRapid committed Apr 6, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/lib/spree/preference_access.rb
@@ -6,7 +6,7 @@ def get(key = nil)
key = key.to_s if key.is_a?(Symbol)
return nil unless config = self.instance
# preferences will be cached under the name of the class including this module (ex. Spree::Config)
- prefs = Rails.cache.fetch("configuration_#{config.id}".to_sym) { config.preferences }
+ prefs = Rails.cache.fetch("configuration_#{config.class.name}".to_sym) { config.preferences }
return prefs if key.nil?
prefs[key]
end
@@ -18,7 +18,7 @@ def set(preferences={})
config.set_preference(key, value)
end
config.save
- Rails.cache.delete("configuration_#{config.id}".to_sym)
+ Rails.cache.delete("configuration_#{config.class.name}".to_sym)
end
alias_method :[], :get

0 comments on commit a59ae3a

Please sign in to comment.