<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/strokedb/stroke_objects/lazy_accessors.rb</filename>
    </added>
    <added>
      <filename>lib/strokedb/stroke_objects/slot_hooks.rb</filename>
    </added>
    <added>
      <filename>spec/lib/stroke_objects/lazy_accessors_spec.rb</filename>
    </added>
    <added>
      <filename>spec/lib/stroke_objects/spec_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -20,7 +20,7 @@ module MML
     include CommonMixins
     
     belongs_to :owner
-    has_many :account_memberships, :slot =&gt; :account
+    has_many :account_memberships, :as =&gt; :account
     has_many :members, :through =&gt; :account_memberships
     has_many :projects
     
@@ -39,11 +39,11 @@ module MML
   
   module Person
     include CommonMixins
-    has_many :owned_accounts, :slot =&gt; :owner
+    has_many :owned_accounts, :as =&gt; :owner
     
-    has_many :account_memberships, :slot =&gt; :person
+    has_many :account_memberships, :as =&gt; :person
     has_many :accounts, :through =&gt; :account_memberships
-    has_many :project_memberships, :slot =&gt; :person
+    has_many :project_memberships, :as =&gt; :person
     has_many :projects, :through =&gt; :project_memberships
   end
 
@@ -61,9 +61,9 @@ module MML
     include CommonMixins
     
     belongs_to :account
-    has_many :project_memberships, :slot =&gt; :project
+    has_many :project_memberships, :as =&gt; :project
     has_many :members, :through =&gt; :project_memberships
-    has_many :files, :slot =&gt; :folder
+    has_many :files, :as =&gt; :folder
     
     validates_kind_of :account, Account
   end
@@ -94,7 +94,7 @@ oleg = verify { Person.create(:name =&gt; &quot;Oleg Andreev&quot;, :email =&gt; &quot;oleganza@gmail
 oleg_account = verify { Account.create(:name =&gt; &quot;Oleg Andreev's account&quot;, :owner =&gt; oleg) }
 oleg_personal_account = verify { oleg.owned_accounts.create(:name =&gt; &quot;Oleg Andreev's personal account&quot;) }
 
-
+verify { oleg.accounts.size == 2 }
 
 
 </diff>
      <filename>examples/mml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ module StrokeDB
     end # ClassMethods
     
     class BelongsTo
-      attr_accessor :slotname, :boolean
+      attr_accessor :slotname
       
       def initialize(options)
         @options = OptionsHash(options)</diff>
      <filename>lib/strokedb/associations/belongs_to.rb</filename>
    </modified>
    <modified>
      <diff>@@ -0,0 +1,49 @@
+module StrokeDB
+  module Associations
+    module ClassMethods
+      #  
+      # class WebSite
+      #   has_many :pages
+      #   has_many :reviews, :as =&gt; :reviewable_object
+      #   has_many :visits
+      #   has_many :visitors, :through =&gt; :visits
+      #
+      def has_many(slotname, options = {}, &amp;blk)
+        if blk
+          options[:extensions] ||= []
+          options[:extensions] &lt;&lt; Module.new(&amp;blk)
+        end
+        register_association(HasMany.new({:slotname =&gt; slotname}.merge(options)))
+      end
+    end # ClassMethods
+    
+    class HasMany
+      attr_accessor :slotname
+      
+      def initialize(options)
+        @options = OptionsHash(options)
+        @slotname = @options.require(:slotname)
+      end
+      
+      def setup(mod)
+        slotname = @slotname
+        mod.send(:define_method, slotname) do
+          self[slotname]
+        end
+        mod.send(:define_method, slotname.to_s + &quot;=&quot;) do |value|
+          self[slotname] = value
+        end
+        
+        # self.on_get_slot(slotname, )
+        # on slot access -&gt; create proxy
+      end
+      
+      class CollectionProxy
+        def initialize(document)
+          
+        end
+      end
+    
+    end # BelongsTo
+  end # Validations
+end # StrokeDB</diff>
      <filename>lib/strokedb/associations/has_many.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'strokedb/stroke_objects/lazy_accessors.rb'
+require 'strokedb/stroke_objects/slot_hooks.rb'
 require 'strokedb/stroke_objects/instance_methods.rb'
 require 'strokedb/stroke_objects/class_methods.rb'
 require 'strokedb/stroke_objects/database.rb'</diff>
      <filename>lib/strokedb/stroke_objects.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e28351249b9c6887e6a0a82eabb8b791802dac07</id>
    </parent>
  </parents>
  <author>
    <name>Oleg Andreev</name>
    <email>oleganza@gmail.com</email>
  </author>
  <url>http://github.com/oleganza/strokedb-core/commit/8b28964d5828604cbde9292890a6bf22c938b362</url>
  <id>8b28964d5828604cbde9292890a6bf22c938b362</id>
  <committed-date>2008-08-22T09:27:58-07:00</committed-date>
  <authored-date>2008-08-22T09:27:58-07:00</authored-date>
  <message>added slots API: lazy_accessors (with specs), slot_hooks (draft)</message>
  <tree>cc51aa85b26f8b0082453659c593793ea33e3534</tree>
  <committer>
    <name>Oleg Andreev</name>
    <email>oleganza@gmail.com</email>
  </committer>
</commit>
