Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in error name #1180

Merged
merged 2 commits into from
Nov 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ pub enum DbErr {
/// After an insert statement it was impossible to retrieve the last_insert_id
#[error("Failed to unpack last_insert_id")]
UnpackInsertId,
/// When updating, a model should know it's primary key to check
/// When updating, a model should know its primary key to check
/// if the record has been correctly updated, otherwise this error will occur
#[error("Failed to get primary key from model")]
UpdateGetPrimeryKey,
UpdateGetPrimaryKey,
/// The record was not found in the database
#[error("RecordNotFound Error: {0}")]
RecordNotFound(String),
Expand Down
2 changes: 1 addition & 1 deletion src/executor/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ where
Updater::new(query).check_record_exists().exec(db).await?;
let primary_key_value = match model.get_primary_key_value() {
Some(val) => FromValueTuple::from_value_tuple(val),
None => return Err(DbErr::UpdateGetPrimeryKey),
None => return Err(DbErr::UpdateGetPrimaryKey),
};
let found = <A::Entity as EntityTrait>::find_by_id(primary_key_value)
.one(db)
Expand Down