German Velasco

Results 121 comments of German Velasco

My only concern with `child_of` is that it might be confusing since a "child" css selector is the immediate descendant, not just any descendant. I know the query struct is...

Sorry I didn't come back here to respond sooner! I think `nested_under` is pretty good, though I do like the notion of child or descendant, since that's how the W3...

Hi @axelson and @AndrewDryga, when the associations reference each other in the factory definition, trying to `insert` them will lead to that primary key constraint violation, like you mention. That's...

@AndrewDryga we're not actually inserting the same record twice. We're building the whole struct (with all the nested structs), we cast all the values, and then we're using Ecto's [insert!/2](https://hexdocs.pm/ecto/Ecto.Repo.html#c:insert!/2)...

Hi @Adzz, I'm not a 100% sure, but I think this is what's happening. First, I think the `for` comprehension is irrelevant to the problem. So think doing this will...

Opened up a PR that I think fixes this issue. Let me know what you think -> https://github.com/thoughtbot/ex_machina/pull/406

Hi @mojidabckuu I think what you're looking for has an open PR, and we're looking for someone to add tests to it, if you're up for it! https://github.com/thoughtbot/ex_machina/pull/377

I just pushed v2.6.0 of ExMachina which includes passing Repo options to [`insert/3`](https://hexdocs.pm/ex_machina/2.6.0/ExMachina.Ecto.html#c:insert/3). Hope that helps with this issue!

@mathieuprog thanks for opening this. I don't know right now how we could allow customization of the Ecto strategy in order to allow for custom casting of polymorphic embeds. Typically,...

@mathieuprog thanks for linking to those potential solutions. I haven't fully considered how we'd implement that in ExMachina's side, but just from looking at the suggestions, I think option 1...