Created
June 13, 2014 15:28
-
-
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
This file contains 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
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