Sha256: f30f2f51e7e176b0771650cf71cac0b8e396fe1c3a65498786b86dafc5021da4

Contents?: true

Size: 593 Bytes

Versions: 3

Compression:

Stored size: 593 Bytes

Contents

cache_key :product do
  Product
end

cache_key :color_variation do
  [ColorVariation]
end

cache_key :product_and_color_variation do
  [Product, ColorVariation]
end

scope :product do
  cache_method :slow_method
  cache_method :slow_method_with_args

  cache_class_method :slow_class_method
  cache_class_method :slow_class_method_with_args
end

scope :color_variation do
  cache_method :slow_method, 'product'

  cache_method :slow_method_with_product do |s|
    s.product
  end

  cache_class_method :slow_class_method, 'product'

  cache_field :product_code, :from => [:product, :code]
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qor_cache-0.0.4 config/qor/cache.rb
qor_cache-0.0.2 config/qor/cache.rb
qor_cache-0.0.1 config/qor/cache.rb