<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>config/cached_models.rb</filename>
    </added>
    <added>
      <filename>lib/cached_models.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,5 @@
+* Made independent of Rails
+
 * Allow test suite to work without any active cache server
 
 * Enhanced AssociationCollection test coverage</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,2 @@
 # Include hook code here
-require File.dirname(__FILE__) + '/lib/active_record' if ActionController::Base.perform_caching
-
+require 'cached_models'</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,7 @@
 module ActiveRecord
   class Base
-    class &lt;&lt; self
-      def rails_cache
-        ::Rails.cache
-      end
-    end
+    @@rails_cache = nil
+    mattr_reader :rails_cache
 
     protected
       def rails_cache</diff>
      <filename>lib/active_record/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,11 +4,13 @@ class BaseTest &lt; Test::Unit::TestCase
   fixtures :authors
 
   def test_should_have_cache
-    assert_equal RAILS_CACHE, ActiveRecord::Base.rails_cache
+    assert_equal RAILS_CACHE, ActiveRecord::Base.rails_cache if defined? Rails
+    assert_kind_of ActiveSupport::Cache::Store, ActiveRecord::Base.rails_cache
   end
   
   def test_should_wrap_rails_cache
-    assert_equal RAILS_CACHE, Post.new.send(:rails_cache)
+    assert_equal RAILS_CACHE, Post.new.send(:rails_cache) if defined? Rails
+    assert_kind_of ActiveSupport::Cache::Store, Post.new.send(:rails_cache)
   end
   
   def test_reflection_cache_key
@@ -27,4 +29,11 @@ class BaseTest &lt; Test::Unit::TestCase
     author.send(:cache_delete, Author.reflections[:cached_posts])
     assert_equal({:cached_posts =&gt; false}, author.send(:cached_associations))
   end
+
+  def test_should_load_without_rails
+    configuration = File.dirname(__FILE__) + '/../../config/cached_models.rb'
+    options = eval IO.read(configuration), binding, configuration
+    cache = ActiveSupport::Cache.lookup_store(options)
+    assert_kind_of ActiveSupport::Cache::Store, cache
+  end
 end</diff>
      <filename>test/active_record/base_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1f5037f17c4da12cdb2ae00159bbdf5bdd846084</id>
    </parent>
  </parents>
  <author>
    <name>Luca Guidi</name>
    <email>guidi.luca@gmail.com</email>
  </author>
  <url>http://github.com/jodosha/cached-models/commit/41bc59415a278cd4139199ec2f61494ce51e8caa</url>
  <id>41bc59415a278cd4139199ec2f61494ce51e8caa</id>
  <committed-date>2008-10-06T02:47:57-07:00</committed-date>
  <authored-date>2008-10-06T02:47:57-07:00</authored-date>
  <message>Made independent of Rails</message>
  <tree>315f4844aaa4d770ea1f21ea9c61bc3784bdcada</tree>
  <committer>
    <name>Luca Guidi</name>
    <email>guidi.luca@gmail.com</email>
  </committer>
</commit>
