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

Use full qualifier in derives #1665

Merged
merged 2 commits into from
Mar 24, 2024
Merged

Use full qualifier in derives #1665

merged 2 commits into from
Mar 24, 2024

Conversation

AlbertMarashi
Copy link
Contributor

PR Info

  • Closes

  • Dependencies:

  • Dependents:

New Features

  • use full qualifier

Bug Fixes

  • not using full qualifier is considered back practice in derives

Breaking Changes

  • should not be a breaking change

Changes

  • [ ]

@AlbertMarashi AlbertMarashi changed the title Update active_model.rs Use full qualifier in derives May 22, 2023
Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AlbertMarashi, thanks for the help!! I think we have a few more to fix. Thanks a lot!!

  • Ok(quote!(
    #[automatically_derived]
    impl std::convert::TryFrom<ActiveModel> for <Entity as EntityTrait>::Model {
    type Error = sea_orm::DbErr;
    fn try_from(a: ActiveModel) -> Result<Self, sea_orm::DbErr> {
    #(if matches!(a.#active_model_field, sea_orm::ActiveValue::NotSet) {
    return Err(sea_orm::DbErr::AttrNotSet(stringify!(#active_model_field).to_owned()));
    })*
    Ok(
    Self {
    #(#model_field: #model_field_value),*
    }
    )
    }
    }
    #[automatically_derived]
    impl sea_orm::TryIntoModel<<Entity as EntityTrait>::Model> for ActiveModel {
    fn try_into_model(self) -> Result<<Entity as EntityTrait>::Model, sea_orm::DbErr> {
    self.try_into()
    }
    }
    ))

Added missing sea_orm qualifier
@AlbertMarashi
Copy link
Contributor Author

@billy1624 done. I'm not entirely sure if these were in any other files either

@AlbertMarashi
Copy link
Contributor Author

@billy1624 bump

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 20, 2023

The DeriveActiveModel macro assumes entity::prelude is imported in scope, but I guess no harm to fully-qualify?

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! @AlbertMarashi

@AlbertMarashi
Copy link
Contributor Author

Will this get merged?

@tyt2y3
Copy link
Member

tyt2y3 commented Mar 22, 2024

thanks for the nudge. yes I'll merge it

@tyt2y3 tyt2y3 merged commit 96917c5 into SeaQL:master Mar 24, 2024
@AlbertMarashi AlbertMarashi deleted the patch-2 branch March 24, 2024 13:05
Copy link

github-actions bot commented Aug 4, 2024

🎉 Released In 1.0.0 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants