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

Is there any support for many-to-many relation #5

Closed
pankaj-ag opened this issue Jun 4, 2020 · 5 comments · Fixed by #9
Closed

Is there any support for many-to-many relation #5

pankaj-ag opened this issue Jun 4, 2020 · 5 comments · Fixed by #9
Assignees

Comments

@pankaj-ag
Copy link

Thank you for this package. It works great.

I just want to know that is there any way I can have many-to-many relations in the TypedEctoSchema module?

@bamorim
Copy link
Owner

bamorim commented Aug 3, 2020

@pankaj-ag I don't think I've done that but it is easy to add this. I'll tackle that this weekend.

Sorry for the delay in the response, it got lost in the GitHub notifications.

@bamorim bamorim self-assigned this Aug 3, 2020
@ericlathrop
Copy link

It appears to output term() for the typespec on many_to_many associations, when it should be something like [MyType.t()] | nil. Overriding the type produces this error:

** (CompileError) lib/sql_membership_provider/role.ex:21: misplaced operator ::/2

The :: operator is typically used in bitstrings to specify types and sizes of segments:

    <<size::32-integer, letter::utf8, rest::binary>>

It is also used in typespecs, such as @type and @spec, to describe inputs and outputs
    expanding macro: Ecto.Schema.schema/2

@bamorim
Copy link
Owner

bamorim commented Feb 5, 2021

Hey @pankaj-ag and @ericlathrop. Sorry for being unresponsive. I'll take a deeper look into that as soon as I have time.

@ericlathrop
Copy link

No worries! I would've made a PR myself, but I got distracted by all my own projects that I'm neglecting 😉

@bamorim
Copy link
Owner

bamorim commented Feb 5, 2021

@ericlathrop @pankaj-ag

I have just opened a PR for this: #9

I haven't tested much though, but it looks like it is working.

If you have spare time and would like to help me testing and reviewing code, that would be appreciated.

I'll however wait for #8 to be merged first and will rebase it later.

@bamorim bamorim linked a pull request Feb 5, 2021 that will close this issue
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 a pull request may close this issue.

3 participants