<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -11,6 +11,7 @@ merb_more_gem_paths = %w[
   merb-action-args 
   merb-assets 
   merb-slices
+  merb-actionorm
   merb-auth
   merb-cache 
   merb-exceptions
@@ -44,7 +45,8 @@ merb_release = {
       &quot;merb-param-protection&quot;,
       &quot;merb_datamapper&quot;,
       &quot;merb&quot;,
-      &quot;merb-more&quot;
+      &quot;merb-more&quot;,
+      &quot;merb-actionorm&quot;
     ]
 }
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@ module ActionORM
   module Core
     module ClassMethods
       def supports?(obj)
-        find_key(obj)
+        !find_key(obj).nil?
       end
 
       def for(obj)</diff>
      <filename>merb-actionorm/lib/merb-actionorm/action_orm/core.rb</filename>
    </modified>
    <modified>
      <diff>@@ -93,4 +93,33 @@ describe &quot;merb-actionorm&quot; do
     end
   end
   
+  describe &quot;FakeModel&quot; do
+    before(:all) do
+      class FakeModel
+        def valid?
+          false
+        end
+        def new_record?
+          true
+        end
+        def errors
+          FakeErrors.new(self)
+        end
+        def to_s
+          'fake_model'
+        end
+      end
+      ActionORM.use :driver =&gt; ActionORM::Drivers::AbstractDriver, :for =&gt; FakeModel
+      @model_instance = FakeModel.new
+    end
+    
+    it &quot;should support the orm&quot; do
+      ActionORM.supports?(@model_instance).should be_true
+    end
+
+    it &quot;should know if a record is a new record or not&quot; do
+      ActionORM.for(@model_instance).new_record?.should be_true
+    end
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>merb-actionorm/spec/merb-actionorm_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require 'merb-actionorm'
 action_orm_path = File.join(File.dirname(__FILE__), '..', 'lib', 'merb-actionorm', 'action_orm')
 require File.join(action_orm_path, 'test_orm_model')
 require File.join(action_orm_path, 'drivers','test_orm_driver')
+require 'rubygems'
 
 begin
   gem 'sequel'</diff>
      <filename>merb-actionorm/spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,7 @@ spec = Gem::Specification.new do |s|
   s.email = EMAIL
   s.homepage = HOMEPAGE
   s.add_dependency(&quot;merb-auth-core&quot;, &quot;&gt;= #{Merb::VERSION}&quot;)
+  s.add_dependency(&quot;merb-actionorm&quot;, &quot;&gt;= #{Merb::VERSION}&quot;)
   s.require_path = 'lib'
   s.files = %w(LICENSE README.textile Rakefile TODO) + Dir.glob(&quot;{lib,spec}/**/*&quot;)
   </diff>
      <filename>merb-auth/merb-auth-more/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 require &quot;digest/sha1&quot;
+require 'merb-actionorm'
 require File.expand_path(File.dirname(__FILE__) / &quot;..&quot;) / &quot;strategies&quot; / &quot;abstract_password&quot;
 
+
 class Merb::Authentication
   module Mixins
     # This mixin provides basic salted user password encryption.
@@ -66,7 +68,7 @@ class Merb::Authentication
         
         def encrypt_password
           return if password.blank?
-          self.salt = Digest::SHA1.hexdigest(&quot;--#{Time.now.to_s}--#{Merb::Authentication::Strategies::Basic::Base.login_param}--&quot;) if new_record?
+          self.salt = Digest::SHA1.hexdigest(&quot;--#{Time.now.to_s}--#{Merb::Authentication::Strategies::Basic::Base.login_param}--&quot;) if ActionORM.for(self).new_record?
           self.crypted_password = encrypt(password)
         end
         </diff>
      <filename>merb-auth/merb-auth-more/lib/merb-auth-more/mixins/salted_user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,6 +32,7 @@ spec = Gem::Specification.new do |s|
   s.email = GEM_EMAIL
   s.homepage = PROJECT_URL
   s.add_dependency('merb-core', &quot;&gt;= #{Merb::VERSION}&quot;)
+  s.add_dependency('merb-actionorm', &quot;&gt;= #{Merb::VERSION}&quot;)
   s.require_path = 'lib'
   s.files = %w(LICENSE README Rakefile TODO) + Dir.glob(&quot;{lib,spec}/**/*&quot;)
 end</diff>
      <filename>merb-helpers/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 module Merb
   
   module Helpers
+    require 'merb-actionorm'
     
     @@helpers_dir   = File.dirname(__FILE__) / 'merb-helpers'
     @@helpers_files = Dir[&quot;#{@@helpers_dir}/*_helpers.rb&quot;].collect {|h| h.match(/\/(\w+)\.rb/)[1]}</diff>
      <filename>merb-helpers/lib/merb-helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -131,7 +131,7 @@ module Merb::Helpers::Form::Builder
       attrs[:method] = :post unless attrs[:method] == :get
       # Use a fake PUT if the object is not new, otherwise use the method
       # passed in. Defaults to :post if no method is set.
-      method ||= (@obj.respond_to?(:new_record?) &amp;&amp; !@obj.new_record?) || (@obj.respond_to?(:new?) &amp;&amp; !@obj.new?) ? :put : :post
+      method ||= (ActionORM.supports?(@obj) &amp;&amp; !ActionORM.for(@obj).new_record?) || (@obj.respond_to?(:new?) &amp;&amp; !@obj.new?) ? :put : :post
 
       attrs[:enctype] = &quot;multipart/form-data&quot; if attrs.delete(:multipart) || @multipart
 </diff>
      <filename>merb-helpers/lib/merb-helpers/form/builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,3 +55,5 @@ class FakeModel
     'fake_model'
   end
 end
+
+ActionORM.use :driver =&gt; ActionORM::Drivers::AbstractDriver, :for =&gt; FakeModel
\ No newline at end of file</diff>
      <filename>merb-helpers/spec/fixture/app/models/first_generic_fake_model.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,13 +4,13 @@ require &quot;merb-core&quot;
 require File.join(File.dirname(__FILE__),&quot;..&quot;,'lib',&quot;merb-helpers&quot;)
 require &quot;date&quot;
 require &quot;webrat&quot;
+require 'merb-actionorm'
 
 # Please read merb_helpers_form_spec.rb
 # for more info on how to test helpers
 # full stack specs are required
 # use the app in spec/fixture to test helpers
 
-
 default_options = {
   :environment =&gt; 'test',
   :adapter     =&gt; 'runner',</diff>
      <filename>merb-helpers/spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ GEM_VERSION = Merb::VERSION + PKG_BUILD
 
 RELEASE_NAME    = &quot;REL #{GEM_VERSION}&quot;
 
-GEM_DEPENDENCIES = [[&quot;dm-core&quot;, &quot;&gt;=0.9.5&quot;], [&quot;dm-migrations&quot;, &quot;&gt;=0.9.5&quot;], [&quot;merb-core&quot;, &quot;~&gt; #{GEM_VERSION}&quot;]]
+GEM_DEPENDENCIES = [[&quot;dm-core&quot;, &quot;&gt;=0.9.5&quot;], [&quot;dm-migrations&quot;, &quot;&gt;=0.9.5&quot;], [&quot;merb-core&quot;, &quot;~&gt; #{GEM_VERSION}&quot;], [&quot;merb-actionorm&quot;, &quot;~&gt; #{GEM_VERSION}&quot;]]
 
 require &quot;extlib/tasks/release&quot;
 </diff>
      <filename>merb_datamapper/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 if defined?(Merb::Plugins)
   dependency 'dm-core'
+  require 'merb-actionorm'
 
   require File.dirname(__FILE__) / &quot;merb&quot; / &quot;orms&quot; / &quot;data_mapper&quot; / &quot;connection&quot;
   require File.dirname(__FILE__) / &quot;merb&quot; / &quot;session&quot; / &quot;data_mapper_session&quot;
@@ -93,7 +94,7 @@ if defined?(Merb::Plugins)
         private
         
         def set_timestamps
-          return unless dirty? || new_record?
+          return unless dirty? || ActionORM.for(self).new_record?
           TIMESTAMP_PROPERTIES.each do |name,(_type,proc)|
             if model.properties.has_property?(name)
               model.properties[name].set(self, proc.call(self, model.properties[name])) unless attribute_dirty?(name)</diff>
      <filename>merb_datamapper/lib/merb_datamapper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fe3d2b64a42f84e695fa806700a2bdc77cc188e6</id>
    </parent>
  </parents>
  <author>
    <name>Matt Aimonetti</name>
    <email>mattaimonetti@gmail.com</email>
  </author>
  <url>http://github.com/wycats/merb/commit/784ac7d71780d1a7cfb9152ba4cb0e18a990ab7a</url>
  <id>784ac7d71780d1a7cfb9152ba4cb0e18a990ab7a</id>
  <committed-date>2009-04-20T15:27:44-07:00</committed-date>
  <authored-date>2009-04-20T15:27:44-07:00</authored-date>
  <message>fixed a bug in actionorm and started switching gems to use actionorm</message>
  <tree>def9682d9ccd33a681a6e28880819ad0e389a165</tree>
  <committer>
    <name>Matt Aimonetti</name>
    <email>mattaimonetti@gmail.com</email>
  </committer>
</commit>
