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

`#[changeset_for]` fails on structs with a single field #66

Closed
sgrif opened this Issue Dec 20, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@sgrif
Member

sgrif commented Dec 20, 2015

Codegen continues to try to create a tuple, and we don't implement any of our traits for tuples with a single element. This should not create a tuple if there's only one field.

sgrif added a commit that referenced this issue Dec 20, 2015

Ensure `Vec<T>` can be used in `#[changeset_for]`
Usually we implement all the various `AsExpression` for refs in the
`expression_impls!` macro. However, that macro doesn't work with generics,
and we forgot to handle `Vec<T>` (I think I figured the slice impl was
enough for some reason).

I tried to write a test for this change, but there are actually several
other bugs that prevent me from testing this properly. See #65 & #66.

Fixes #63.

@sgrif sgrif added this to the 0.4 milestone Dec 20, 2015

@sgrif sgrif added the bug label Dec 20, 2015

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 7, 2016

Forgot to mention it in the commit, but this was fixed by cf56133

@sgrif sgrif closed this Jan 7, 2016

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