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

save_changes is only available for types that implement Copy #886

Closed
White-Oak opened this Issue May 6, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@White-Oak

White-Oak commented May 6, 2017

As far as I can see, save_changes is only available for types that implement Copy: T: Copy + AsChangeset<Target=T::Table> + IntoUpdateTarget. But for most models that would not be the case, since String, which is arguably one of the most common fields in models, does not implement Copy.

Is it possible to ease the requirements for SaveChangesDsl?

@sgrif

This comment has been minimized.

Member

sgrif commented May 7, 2017

SaveChangesDsl (along with AsChangeset, IntoUpdateTarget, and Identifiable) is implemented on a reference to your struct, not the struct itself. References always implement Copy. If save_changes isn't present, you're probably missing either #[derive(AsChangeset)] or #[derive(Identifiable)]

@sgrif sgrif closed this May 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment