Skip to content

Commit

Permalink
Merge pull request #4848 from abhishekkanojia/refactor_code
Browse files Browse the repository at this point in the history
Remove redundant self from database_authenticatable module.
  • Loading branch information
rafaelfranca authored Apr 23, 2018
2 parents 6260c29 + f99636d commit d98f38c
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 d98f38c

Please sign in to comment.