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

Feature: skip fields when deriving AsChangeset #1944

Closed
Diggsey opened this issue Jan 4, 2019 · 1 comment
Closed

Feature: skip fields when deriving AsChangeset #1944

Diggsey opened this issue Jan 4, 2019 · 1 comment

Comments

@Diggsey
Copy link
Contributor

Diggsey commented Jan 4, 2019

Its convenient to use the same struct sometimes when fetching and updating data (to avoid having to convert one into another) but sometimes you only want to update some of the fields.

It would be useful to be able to mark some fields as ignored for the purposes of deriving AsChangeset.

eg.

#[derive(Queryable, Identifiable, Debug, Clone, AsChangeset)]
pub struct FooBar {
    pub id: Uuid,
    #[changeset_options(skip = true)]
    pub immutable_field: i32,
    pub mutable_field: i32,
}
@sgrif
Copy link
Member

sgrif commented Jan 4, 2019

Duplicate of #860

@sgrif sgrif marked this as a duplicate of #860 Jan 4, 2019
@sgrif sgrif closed this as completed Jan 4, 2019
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

No branches or pull requests

2 participants