Skip to content

Instantly share code, notes, and snippets.

@GertThiel
Created June 13, 2014 15:28
Show Gist options
  • Save GertThiel/7a12d1d4d8044cdb3dc2 to your computer and use it in GitHub Desktop.
Save GertThiel/7a12d1d4d8044cdb3dc2 to your computer and use it in GitHub Desktop.
The initializer of Rails 2.3's ActiveSupport::Cache::Store does not accept options
Rails::Initializer.run do |config|
ActiveSupport::Cache::Store.class_eval do
def initialize(options = {});end
end
#
require 'torquebox-cache'
ActiveSupport::Cache::TorqueBoxStore.class_eval do
def initialize(options = {})
@options = options
super
cache
end
private
def cache
@cache ||= TorqueBox::Infinispan::Cache.new( defaults.merge(@options) )
end
end
config.cache_store = :torque_box_store
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment