<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -23,14 +23,7 @@ module Authlogic
         #   end
         #
         # See the various sub modules for the configuration they provide.
-        def acts_as_authentic(&amp;block)
-          # Stop all configuration if the DB is not set up
-          begin
-            column_names
-          rescue Exception
-            return
-          end
-          
+        def acts_as_authentic(&amp;block)          
           yield self if block_given?
           acts_as_authentic_modules.each { |mod| include mod }
         end
@@ -74,8 +67,12 @@ module Authlogic
           end
 
           def first_column_to_exist(*columns_to_check) # :nodoc:
-            columns_to_check.each { |column_name| return column_name.to_sym if column_names.include?(column_name.to_s) }
-            columns_to_check.first ? columns_to_check.first.to_sym : nil
+            if ActiveRecord::Base.connected?
+              columns_to_check.each { |column_name| return column_name.to_sym if column_names.include?(column_name.to_s) }
+              columns_to_check.first ? columns_to_check.first.to_sym : nil
+            else
+              return columns_to_check.first ? columns_to_check.first.to_sym : nil
+            end
           end
 
       end</diff>
      <filename>lib/authlogic/acts_as_authentic/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ module Authlogic
         # * &lt;tt&gt;Default:&lt;/tt&gt; :login or :username, if they exist
         # * &lt;tt&gt;Accepts:&lt;/tt&gt; Symbol
         def login_field(value = nil)
-          config(:login_field, value, first_column_to_exist(nil, :login, :username))
+          config(:login_field, value, first_column_to_exist(:login, :username))
         end
         alias_method :login_field=, :login_field
         </diff>
      <filename>lib/authlogic/acts_as_authentic/login.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,16 +6,35 @@ module Authlogic
     module MagicColumns
       def self.included(klass)
         klass.class_eval do
+          extend Config
           add_acts_as_authentic_module(Methods)
         end
       end
       
+      # Change how the magic columns works.
+      module Config
+        # Whether or not the validate the login_count and failed_login_count fields
+        #
+        # * &lt;tt&gt;Default:&lt;/tt&gt; true
+        # * &lt;tt&gt;Accepts:&lt;/tt&gt; Boolean
+        def validate_magic_columns(value = nil)
+          config(:validate_magic_columns, value, true)
+        end
+        alias_method :validate_magic_columns=, :validate_magic_columns
+      end
+
       # Methods relating to the magic columns
       module Methods
         def self.included(klass)
           klass.class_eval do
-            validates_numericality_of :login_count, :only_integer =&gt; :true, :greater_than_or_equal_to =&gt; 0, :allow_nil =&gt; true if column_names.include?(&quot;login_count&quot;)
-            validates_numericality_of :failed_login_count, :only_integer =&gt; :true, :greater_than_or_equal_to =&gt; 0, :allow_nil =&gt; true if column_names.include?(&quot;failed_login_count&quot;)
+            include InstanceMethods
+            validates_numericality_of :login_count, :only_integer =&gt; :true, :greater_than_or_equal_to =&gt; 0, :allow_nil =&gt; true, :if =&gt; :validate_magic_columns?
+            validates_numericality_of :failed_login_count, :only_integer =&gt; :true, :greater_than_or_equal_to =&gt; 0, :allow_nil =&gt; true, :if =&gt; :validate_magic_columns?
+          end
+        end
+        module InstanceMethods
+          def validate_magic_columns?
+            self.class.validate_magic_columns == true
           end
         end
       end</diff>
      <filename>lib/authlogic/acts_as_authentic/magic_columns.rb</filename>
    </modified>
    <modified>
      <diff>@@ -34,12 +34,21 @@ module Authlogic
           config(:disable_perishable_token_maintenance, value, false)
         end
         alias_method :disable_perishable_token_maintenance=, :disable_perishable_token_maintenance
+        
+        # The perishable token can be disabled completely
+        #
+        # * &lt;tt&gt;Default:&lt;/tt&gt; false
+        # * &lt;tt&gt;Accepts:&lt;/tt&gt; Boolean
+        def disable_perishable_token(value = nil)
+          config(:disable_perishable_token, value, false)
+        end
+        alias_method :disable_perishable_token=, :disable_perishable_token
       end
       
       # All methods relating to the perishable token.
       module Methods
         def self.included(klass)
-          return if !klass.column_names.include?(&quot;perishable_token&quot;)
+          return if :disable_perishable_token? || !klass.column_names.include?(&quot;perishable_token&quot;)
           
           klass.class_eval do
             extend ClassMethods
@@ -93,6 +102,11 @@ module Authlogic
           def disable_perishable_token_maintenance?
             self.class.disable_perishable_token_maintenance == true
           end
+          
+          # A convenience method based on the disable_perishable_token configuration option.
+          def disable_perishable_token?
+            self.class.disable_perishable_token == true
+          end
         end
       end
     end</diff>
      <filename>lib/authlogic/acts_as_authentic/perishable_token.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,12 +23,21 @@ module Authlogic
           config(:change_single_access_token_with_password, value, false)
         end
         alias_method :change_single_access_token_with_password=, :change_single_access_token_with_password
+        
+        # The single access token can be disabled completely by changing the following to true
+        #
+        # * &lt;tt&gt;Default:&lt;/tt&gt; false
+        # * &lt;tt&gt;Accepts:&lt;/tt&gt; Boolean
+        def disable_single_access_token(value = nil)
+          config(:disable_single_access_token, value, false)
+        end
+        alias_method :disable_single_access_token=, :disable_single_access_token
       end
       
       # All method, for the single_access token aspect of acts_as_authentic.
       module Methods
         def self.included(klass)
-          return if !klass.column_names.include?(&quot;single_access_token&quot;)
+          return if :disable_single_access_token? || !klass.column_names.include?(&quot;single_access_token&quot;)
             
           klass.class_eval do
             include InstanceMethods
@@ -58,6 +67,10 @@ module Authlogic
             def change_single_access_token_with_password?
               self.class.change_single_access_token_with_password == true
             end
+            
+            def disable_single_access_token?
+              self.class.disable_single_access_token == true
+            end
         end
       end
     end</diff>
      <filename>lib/authlogic/acts_as_authentic/single_access_token.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>607e3ecdc76e3d854c174d8b310e02ad59864dc5</id>
    </parent>
  </parents>
  <author>
    <name>Sean O'Brien</name>
    <email>sean.obrien56@yahoo.com</email>
  </author>
  <url>http://github.com/sob/authlogic/commit/9c18dbeeff608974a840bb8737d708479f51854b</url>
  <id>9c18dbeeff608974a840bb8737d708479f51854b</id>
  <committed-date>2009-04-01T13:40:52-07:00</committed-date>
  <authored-date>2009-04-01T13:40:52-07:00</authored-date>
  <message>* removed the need for the connection to be established before loading.
* added a validate_magic_columns config option
* added a disable_perishable_token config option
* added a disable_single_access_token config option</message>
  <tree>09ac3bbe9d280734618a1b357eef4f5dd6c67db1</tree>
  <committer>
    <name>Sean O'Brien</name>
    <email>sean.obrien56@yahoo.com</email>
  </committer>
</commit>
