Index: test/cache_test.rb =================================================================== --- test/cache_test.rb (revision 409) +++ test/cache_test.rb (working copy) @@ -227,7 +227,7 @@ include StoryCacheSpecSetup specify "should be able to retrieve a cached version of itself" do - Story.expects(:get_cache).with(1).at_least_once + Story.expects(:get_cache).with(1, {}).at_least_once @story.get_cache end @@ -242,6 +242,11 @@ @story.should.have.cached :block @story.get_cache(:block).should.equal "this is a block" end + + specify "should allow setting custom options by passing them to get_cache" do + Story.expects(:set_cache).with('1:options', 'cached value', 1.hour) + @story.get_cache(:options, :ttl => 1.hour) { 'cached value' } + end specify "should be able to expire its cache" do Story.expects(:expire_cache).with(2) Index: lib/acts_as_cached/cache_methods.rb =================================================================== --- lib/acts_as_cached/cache_methods.rb (revision 409) +++ lib/acts_as_cached/cache_methods.rb (working copy) @@ -226,8 +226,8 @@ base.send :delegate, :cache_options, :to => 'self.class' end - def get_cache(key = nil, &block) - self.class.get_cache(cache_id(key), &block) + def get_cache(key = nil, options = {}, &block) + self.class.get_cache(cache_id(key), options, &block) end def set_cache(ttl = nil)