Permalink
Browse files

* Fix bug when password is turned off and the SingleAccessToken modul…

…e calls the after_password_set callback.
  • Loading branch information...
1 parent 0823cc7 commit 43360a3b7869a6350eaeb5502c0b3f15400ce65f @binarylogic committed Apr 21, 2009
View
@@ -1,4 +1,8 @@
-== 2.0.10
+== 2.0.11
+
+* Fix bug when password is turned off and the SingleAccessToken module calls the after_password_set callback.
+
+== 2.0.10 release 2009-4-21
* Mock request is now transparent to non existent methods. Since the methods calls really have no functional value when testing authlogic.
* Allow password confirmation to be disabled.
@@ -34,7 +34,7 @@ def self.included(klass)
include InstanceMethods
validates_uniqueness_of :single_access_token, :if => :single_access_token_changed?
before_validation :reset_single_access_token, :if => :reset_single_access_token?
- after_password_set :reset_single_access_token, :if => :change_single_access_token_with_password?
+ after_password_set(:reset_single_access_token, :if => :change_single_access_token_with_password?) if respond_to?(:after_password_set)
end
end
@@ -35,5 +35,10 @@ def test_after_password_set_reset_single_access_token
User.change_single_access_token_with_password = false
end
+
+ def test_after_password_set_is_not_called
+ ldaper = Ldaper.new
+ assert ldaper.save
+ end
end
end
View
@@ -0,0 +1,3 @@
+class Ldaper < ActiveRecord::Base
+ acts_as_authentic
+end
View
@@ -79,6 +79,13 @@
t.string :pw_salt
t.string :persistence_token
end
+
+ create_table :ldapers do |t|
+ t.datetime :created_at
+ t.datetime :updated_at
+ t.string :ldap_login
+ t.string :persistence_token
+ end
end
require File.dirname(__FILE__) + '/../lib/authlogic' unless defined?(Authlogic)
@@ -87,6 +94,7 @@
require File.dirname(__FILE__) + '/libs/affiliate'
require File.dirname(__FILE__) + '/libs/employee'
require File.dirname(__FILE__) + '/libs/employee_session'
+require File.dirname(__FILE__) + '/libs/ldaper'
require File.dirname(__FILE__) + '/libs/user'
require File.dirname(__FILE__) + '/libs/user_session'
require File.dirname(__FILE__) + '/libs/company'

0 comments on commit 43360a3

Please sign in to comment.