Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…e calls the after_password_set callback.
  • Loading branch information...
commit 43360a3b7869a6350eaeb5502c0b3f15400ce65f 1 parent 0823cc7
@binarylogic authored
View
6 CHANGELOG.rdoc
@@ -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.
View
2  lib/authlogic/acts_as_authentic/single_access_token.rb
@@ -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
View
5 test/acts_as_authentic_test/single_access_test.rb
@@ -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
3  test/libs/ldaper.rb
@@ -0,0 +1,3 @@
+class Ldaper < ActiveRecord::Base
+ acts_as_authentic
+end
View
8 test/test_helper.rb
@@ -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'
Please sign in to comment.
Something went wrong with that request. Please try again.