Fix up previous commit and update CHANGELOG.
This commit is contained in:
parent
5570929b56
commit
5909d6a0c5
|
@ -1,3 +1,11 @@
|
||||||
|
== 1.5.2 (dev)
|
||||||
|
|
||||||
|
* enhancements
|
||||||
|
* Add support for rails 3.1 new mass assignment conventions (by github.com/kirs)
|
||||||
|
|
||||||
|
* bug fix
|
||||||
|
* OmniAuth error message now shows the proper option (:strategy_class instead of :klass)
|
||||||
|
|
||||||
== 1.5.1
|
== 1.5.1
|
||||||
|
|
||||||
* bug fix
|
* bug fix
|
||||||
|
|
|
@ -52,7 +52,6 @@ module Devise
|
||||||
# error on :current_password. It also automatically rejects :password and
|
# error on :current_password. It also automatically rejects :password and
|
||||||
# :password_confirmation if they are blank.
|
# :password_confirmation if they are blank.
|
||||||
def update_with_password(params, *options)
|
def update_with_password(params, *options)
|
||||||
as = options.first[:as] rescue nil
|
|
||||||
current_password = params.delete(:current_password)
|
current_password = params.delete(:current_password)
|
||||||
|
|
||||||
if params[:password].blank?
|
if params[:password].blank?
|
||||||
|
@ -61,7 +60,7 @@ module Devise
|
||||||
end
|
end
|
||||||
|
|
||||||
result = if valid_password?(current_password)
|
result = if valid_password?(current_password)
|
||||||
update_attributes(params, :as => as)
|
update_attributes(params, *options)
|
||||||
else
|
else
|
||||||
self.attributes = params
|
self.attributes = params
|
||||||
self.valid?
|
self.valid?
|
||||||
|
@ -86,16 +85,14 @@ module Devise
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
def update_without_password(params, *options)
|
def update_without_password(params, *options)
|
||||||
as = options.first[:as] rescue nil
|
|
||||||
|
|
||||||
params.delete(:password)
|
params.delete(:password)
|
||||||
params.delete(:password_confirmation)
|
params.delete(:password_confirmation)
|
||||||
|
|
||||||
result = update_attributes(params, :as => as)
|
result = update_attributes(params, *options)
|
||||||
clean_up_passwords
|
clean_up_passwords
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_database_authentication
|
def after_database_authentication
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -110,7 +107,7 @@ module Devise
|
||||||
def downcase_keys
|
def downcase_keys
|
||||||
(self.class.case_insensitive_keys || []).each { |k| self[k].try(:downcase!) }
|
(self.class.case_insensitive_keys || []).each { |k| self[k].try(:downcase!) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def strip_whitespace
|
def strip_whitespace
|
||||||
(self.class.strip_whitespace_keys || []).each { |k| self[k].try(:strip!) }
|
(self.class.strip_whitespace_keys || []).each { |k| self[k].try(:strip!) }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue