<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,6 @@
 module StrokeDB
   VIEW_CACHE = {}
+  VIEW_STORAGES = {}
   
   View = Meta.new(:nsurl =&gt; STROKEDB_NSURL) do 
     
@@ -191,7 +192,7 @@ module StrokeDB
     
     def storage
       # @storage ||= store.view_storages[self.uuid]
-      @storage ||= ViewStorage.new
+      VIEW_STORAGES[uuid] ||= ViewStorage.new
     end
     private :storage
 </diff>
      <filename>lib/strokedb/views/view.rb</filename>
    </modified>
    <modified>
      <diff>@@ -106,4 +106,10 @@ describe View, &quot;with block defined and saved&quot; do
     lambda { @view.map(1,2).should == [[1,2]]}.should_not raise_error(InvalidViewError)
   end
   
+  it &quot;should have the same storage when reloaded&quot; do
+    storage_id = @view.send(:storage).object_id
+    @view = @view.reload
+    @view.send(:storage).object_id.should == storage_id
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>spec/lib/strokedb/views/view_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>42d9143cf1dbc90e8e8db8e51587c16caa7ab6ca</id>
    </parent>
  </parents>
  <author>
    <name>Yurii Rashkovskii</name>
    <email>yrashk@gmail.com</email>
  </author>
  <url>http://github.com/yrashk/strokedb/commit/cd9a00e70e4a197c121fef6fc62361e948fdd037</url>
  <id>cd9a00e70e4a197c121fef6fc62361e948fdd037</id>
  <committed-date>2008-04-28T23:33:04-07:00</committed-date>
  <authored-date>2008-04-28T23:33:04-07:00</authored-date>
  <message>As a temporary workaround, we'll store references to ViewStorage instances in cache</message>
  <tree>739cdfa6a1b53a424446458d154e841c003726e8</tree>
  <committer>
    <name>Yurii Rashkovskii</name>
    <email>yrashk@gmail.com</email>
  </committer>
</commit>
