Permalink
Browse files

Variation of #1773 of Master - Adding Memoization, Eager Load to impr…

…ove Zone performance
  • Loading branch information...
1 parent d090b83 commit afecc71e381e5518b8e8616a292b1c964b32120e @GeekOnCoffee GeekOnCoffee committed with BDQ Jul 16, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 core/app/models/spree/address.rb
  2. +1 −0 core/app/models/spree/zone.rb
@@ -44,7 +44,7 @@ def zone
end
def zones
- Zone.match(self)
+ @zones ||= Zone.match(self)
end
def same_as?(other)
@@ -53,6 +53,7 @@ def self.match(address)
# convenience method for returning the countries contained within a zone
def country_list
+ @countries ||=
case kind
when 'country'
zoneables

0 comments on commit afecc71

Please sign in to comment.