Skip to content

Commit

Permalink
Remove redundant self from database_authenticatable module.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekkanojia committed Apr 22, 2018
1 parent 6260c29 commit f99636d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/devise/models/database_authenticatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ def update_with_password(params, *options)
result = if valid_password?(current_password)
update(params, *options)
else
self.assign_attributes(params, *options)
self.valid?
self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)
assign_attributes(params, *options)
valid?
errors.add(:current_password, current_password.blank? ? :blank : :invalid)
false
end

Expand Down Expand Up @@ -113,8 +113,8 @@ def destroy_with_password(current_password)
result = if valid_password?(current_password)
destroy
else
self.valid?
self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)
valid?
errors.add(:current_password, current_password.blank? ? :blank : :invalid)
false
end

Expand Down

0 comments on commit f99636d

Please sign in to comment.