Created
July 4, 2014 17:47
-
-
Save beck03076/e6b64c784084a7627d60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product | |
include Mongoid::Document | |
include Mongoid::Timestamps::Short | |
include Tire::Model::Search | |
include Tire::Model::Callbacks | |
cattr_accessor :mag_libs_cache | |
def self.get_prods_by_mode(store, options={}) | |
self.mag_libs_cache ||= {} | |
mag_lib = self.mag_libs_cache[store.id] ||= self.model_name.constantize.get_mag_lib(store) | |
.-- more code -- | |
. | |
. | |
end | |
def self.populate! store_id, options={} | |
self.mag_libs_cache ||= {} | |
mag_lib = self.mag_libs_cache[store.id] ||= self.model_name.constantize.get_mag_lib(store) | |
.-- more code -- | |
. | |
. | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment