<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/associated_form_helper_test.rb</filename>
    </added>
    <added>
      <filename>test/comment_test.rb</filename>
    </added>
    <added>
      <filename>test/db/database.yml</filename>
    </added>
    <added>
      <filename>test/models/comment.rb</filename>
    </added>
    <added>
      <filename>test/models/photo.rb</filename>
    </added>
    <added>
      <filename>test/photo_test.rb</filename>
    </added>
    <added>
      <filename>test/test_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -105,6 +105,12 @@ Come join the discussion on the {mailing list}[link:http://groups.google.com/gro
 
 Updates will be available {here}[http://jamesgolick.com/attribute_fu]
 
+= Running the tests
+
+To run the tests, you need Shoulda, mocha and multi-rails:
+
+  $ sudo gem install thoughtbot-shoulda --source http://gems.github.com/
+  $ sudo gem install mocha multi_rails
 
 == Credits
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'rake'
+require &quot;load_multi_rails_rake_tasks&quot; 
 require 'rake/testtask'
 require 'rake/rdoctask'
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -62,12 +62,14 @@ module AttributeFu
       def save_managed_associations #:nodoc:
         if managed_association_attributes != nil
           managed_association_attributes.keys.each do |association_id|
-            association = send(association_id)
-            association.each(&amp;:save)
+            if send(association_id).loaded? # don't save what we haven't even loaded
+              association = send(association_id)
+              association.each(&amp;:save)
 
-            unless (objects_to_remove = instance_variable_get removal_variable_name(association_id)).nil?
-              objects_to_remove.each { |remove_id| association.delete association.detect { |obj| obj.id.to_s == remove_id.to_s } }
-              instance_variable_set removal_variable_name(association_id), nil
+              unless (objects_to_remove = instance_variable_get removal_variable_name(association_id)).nil?
+                objects_to_remove.each { |remove_id| association.delete association.detect { |obj| obj.id.to_s == remove_id.to_s } }
+                instance_variable_set removal_variable_name(association_id), nil
+              end
             end
           end
         end
@@ -114,10 +116,20 @@ module AttributeFu
             discard_if = discard_if.to_proc if discard_if.is_a?(Symbol)
             managed_association_attributes[association_id][:discard_if] = discard_if
           end
+          collection_with_attributes_writer(association_id)
         end
         
         has_many_without_association_option(association_id, options, &amp;extension)
       end
+      
+    private
+    
+      def collection_with_attributes_writer(association_name)
+        define_method(&quot;#{association_name.to_s.singularize}_attributes=&quot;) do |attributes|
+          has_many_attributes association_name, attributes
+        end
+      end
+      
     end
     
   end # Associations</diff>
      <filename>lib/attribute_fu/associations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,16 @@
-# This file is auto-generated from the current state of the database. Instead of editing this file, 
-# please use the migrations feature of ActiveRecord to incrementally modify your database, and
-# then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your database schema. If you need
-# to create the application database on another system, you should be using db:schema:load, not running
-# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
 ActiveRecord::Schema.define(:version =&gt; 2) do
 
-  create_table &quot;comments&quot;, :force =&gt; true do |t|
-    t.integer  &quot;photo_id&quot;
-    t.string   &quot;author&quot;
-    t.text     &quot;body&quot;
-    t.datetime &quot;created_at&quot;
-    t.datetime &quot;updated_at&quot;
+  create_table :comments, :force =&gt; true do |t|
+    t.integer :photo_id
+    t.string :author
+    t.text :body
+    t.timestamps
   end
 
-  create_table &quot;photos&quot;, :force =&gt; true do |t|
-    t.string   &quot;title&quot;
-    t.text     &quot;description&quot;
-    t.datetime &quot;created_at&quot;
-    t.datetime &quot;updated_at&quot;
+  create_table :photos, :force =&gt; true do |t|
+    t.string :title
+    t.text   :description
+    t.timestamps
   end
 
 end</diff>
      <filename>test/db/schema.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/Rakefile</filename>
    </removed>
    <removed>
      <filename>test/app/controllers/application.rb</filename>
    </removed>
    <removed>
      <filename>test/app/helpers/application_helper.rb</filename>
    </removed>
    <removed>
      <filename>test/app/models/comment.rb</filename>
    </removed>
    <removed>
      <filename>test/app/models/photo.rb</filename>
    </removed>
    <removed>
      <filename>test/config/boot.rb</filename>
    </removed>
    <removed>
      <filename>test/config/database.yml</filename>
    </removed>
    <removed>
      <filename>test/config/environment.rb</filename>
    </removed>
    <removed>
      <filename>test/config/environments/development.rb</filename>
    </removed>
    <removed>
      <filename>test/config/environments/test.rb</filename>
    </removed>
    <removed>
      <filename>test/config/routes.rb</filename>
    </removed>
    <removed>
      <filename>test/db/migrate/001_create_photos.rb</filename>
    </removed>
    <removed>
      <filename>test/db/migrate/002_create_comments.rb</filename>
    </removed>
    <removed>
      <filename>test/script/console</filename>
    </removed>
    <removed>
      <filename>test/script/destroy</filename>
    </removed>
    <removed>
      <filename>test/script/generate</filename>
    </removed>
    <removed>
      <filename>test/script/server</filename>
    </removed>
    <removed>
      <filename>test/test/test_helper.rb</filename>
    </removed>
    <removed>
      <filename>test/test/unit/associated_form_helper_test.rb</filename>
    </removed>
    <removed>
      <filename>test/test/unit/comment_test.rb</filename>
    </removed>
    <removed>
      <filename>test/test/unit/photo_test.rb</filename>
    </removed>
    <removed>
      <filename>test/vendor/plugins/shoulda/init.rb</filename>
    </removed>
    <removed>
      <filename>test/vendor/plugins/shoulda/lib/shoulda.rb</filename>
    </removed>
    <removed>
      <filename>test/vendor/plugins/shoulda/lib/shoulda/active_record_helpers.rb</filename>
    </removed>
    <removed>
      <filename>test/vendor/plugins/shoulda/lib/shoulda/context.rb</filename>
    </removed>
    <removed>
      <filename>test/vendor/plugins/shoulda/lib/shoulda/general.rb</filename>
    </removed>
    <removed>
      <filename>test/vendor/plugins/shoulda/lib/shoulda/private_helpers.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>994845e9d1d17bd25c82d771484c32cdd5bed30b</id>
    </parent>
    <parent>
      <id>a216155f0a0b1cef8b8bfb442fd01ad2dc003a2b</id>
    </parent>
  </parents>
  <author>
    <name>James Golick</name>
    <email>james@giraffesoft.ca</email>
  </author>
  <url>http://github.com/giraffesoft/attribute_fu/commit/2a991eff12d926090ebbcfdde5540a221ea79870</url>
  <id>2a991eff12d926090ebbcfdde5540a221ea79870</id>
  <committed-date>2008-09-28T07:38:00-07:00</committed-date>
  <authored-date>2008-09-28T07:38:00-07:00</authored-date>
  <message>merge collectiveidea/master</message>
  <tree>08d860ecd4d305c3080bd439f15e012926777994</tree>
  <committer>
    <name>James Golick</name>
    <email>james@giraffesoft.ca</email>
  </committer>
</commit>
