<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,65 +1,36 @@
-
 module CollectiveIdea #:nodoc:
   module ActionController #:nodoc:
     module Audited #:nodoc:
+      def audit(*models)
+        ActiveSupport::Deprecation.warn(&quot;#audit is deprecated. Declare #acts_as_audited in your models.&quot;, caller)
+        
+        options = models.extract_options!
+
+        # Parse the options hash looking for classes
+        options.each_key do |key|
+          models &lt;&lt; [key, options.delete(key)] if key.is_a?(Class)
+        end
 
-      def self.included(base) # :nodoc:
-        base.extend ClassMethods
-      end
-
-      module ClassMethods
-        # Declare models that should be audited in your controller
-        #
-        #   class ApplicationController &lt; ActionController::Base
-        #     audit User, Widget
-        #   end
-        #
-        # You can optionally pass options for each model to be audited:
-        #
-        #    audit User, Widget, Task =&gt; { :except =&gt; :position }
-        #
-        # NOTE: Models which do not have options must be listed first in the
-        # call to &lt;tt&gt;audit&lt;/tt&gt;.
-        #
-        # See &lt;tt&gt;CollectiveIdea::Acts::Audited::ClassMethods#acts_as_audited&lt;/tt&gt;
-        # for configuration options
-        #
-        # You can also specify an options hash which will be passed on to
-        # Rails' cache_sweeper call:
-        #
-        #    audit User, :only =&gt; [:create, :edit, :destroy],
-        #
-        def audit(*models)
-          options = models.extract_options!
-
-          # Parse the options hash looking for classes
-          options.each_key do |key|
-            models &lt;&lt; [key, options.delete(key)] if key.is_a?(Class)
-          end
-
-          models.each do |(model, model_options)|
-            model.send :acts_as_audited, model_options || {}
-          end
-
-          class_eval do
-            # prevent observer from being registered multiple times
-            Audit.delete_observer(AuditSweeper.instance)
-            Audit.add_observer(AuditSweeper.instance)      
-            cache_sweeper :audit_sweeper, options
-          end
+        models.each do |(model, model_options)|
+          model.send :acts_as_audited, model_options || {}
         end
       end
-
     end
   end
 end
 
 class AuditSweeper &lt; ActionController::Caching::Sweeper #:nodoc:
-  def before_create(record)
-    record.user ||= current_user
+  def before_create(audit)
+    audit.user ||= current_user
   end
 
   def current_user
     controller.send :current_user if controller.respond_to?(:current_user, true)
   end
 end
+
+ActionController::Base.class_eval do
+  extend CollectiveIdea::ActionController::Audited
+  cache_sweeper :audit_sweeper
+end
+Audit.add_observer(AuditSweeper.instance)</diff>
      <filename>lib/acts_as_audited/audit_sweeper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,5 +5,4 @@ ActiveRecord::Base.send :include, CollectiveIdea::Acts::Audited
 
 if defined?(ActionController) and defined?(ActionController::Base)
   require 'acts_as_audited/audit_sweeper'
-  ActionController::Base.send :include, CollectiveIdea::ActionController::Audited
 end</diff>
      <filename>rails/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,6 @@
 require File.expand_path(File.dirname(__FILE__) + '/test_helper')
 
 class AuditsController &lt; ActionController::Base
-  audit Company, User
-  
   def audit
     @company = Company.create
     render :nothing =&gt; true
@@ -20,11 +18,6 @@ AuditsController.view_paths = [File.dirname(__FILE__)]
 ActionController::Routing::Routes.draw {|m| m.connect ':controller/:action/:id' }
 
 class AuditsControllerTest &lt; ActionController::TestCase
-
-  should &quot;call acts as audited on non audited models&quot; do
-    Company.should be_kind_of(CollectiveIdea::Acts::Audited::SingletonMethods)
-  end
-  
   should &quot;audit user&quot; do
     user = @controller.send(:current_user=, create_user)
     lambda { post :audit }.should change { Audit.count }
@@ -35,5 +28,4 @@ class AuditsControllerTest &lt; ActionController::TestCase
     user = @controller.send(:current_user=, create_user)
     lambda { post :update_user }.should_not change { Audit.count }
   end
-  
 end
\ No newline at end of file</diff>
      <filename>test/audit_sweeper_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a150a7d1502e16de878c60bbac4c821d7960b8e8</id>
    </parent>
  </parents>
  <author>
    <name>Brandon Keepers</name>
    <email>brandon@collectiveidea.com</email>
  </author>
  <url>http://github.com/collectiveidea/acts_as_audited/commit/12fc5b176405a146471b278d95e835ab4c6fdd10</url>
  <id>12fc5b176405a146471b278d95e835ab4c6fdd10</id>
  <committed-date>2009-11-01T09:18:00-08:00</committed-date>
  <authored-date>2009-11-01T08:38:19-08:00</authored-date>
  <message>Deprecated #audit in the controller. User auditing is now always automatically done if your controller has a #current_user method</message>
  <tree>3f6961563c0846d8c0c652169030c2dce7f16541</tree>
  <committer>
    <name>Brandon Keepers</name>
    <email>brandon@collectiveidea.com</email>
  </committer>
</commit>
