-
Notifications
You must be signed in to change notification settings - Fork 230
Closed
Description
Sorcery::Adapters::ActiveRecordAdapter#update_attributes
uses #update_all
inside instead of simply #update
.
I think it intends one active record object to be updated because the code does it, so #updated_all
is not necessary.
If I open a PR, I plan to change from
@model.class.where(:"#{primary_key}" => @model.send(:"#{primary_key}")).update_all(attrs)
to
@model.class.find_by(:"#{primary_key}" => @model.send(:"#{primary_key}")).update(attrs)
The good points are:
- keep the code simple
- return boolean, not integer ( seems more understandable to me )
Thank you for watching, I would appreciate it if someone gives me suggestion.
Metadata
Metadata
Assignees
Labels
No labels