ecto icon indicating copy to clipboard operation
ecto copied to clipboard

Many to many relations fails to preload on Ecto 2.0.0-rc.5

Open lboekhorst opened this issue 10 years ago • 2 comments

Environment

  • Elixir 1.2.3
  • Postgres 9.5.1
  • Ecto 2.0.0-rc-5
  • Postgrex 0.11.1
  • Operating system: OS X El Capitan

Current behavior

Ecto fails to preload a many to many association. You can find a repository that demonstrates the issue at https://github.com/lboekhorst/many_to_many. It has two tests, one to assert that a record is added to the join table (passes), and one test that checks if the length of the preloaded list is equal to 1 (fails).

Expected behavior

I would have expected the preload to fetch the associated Rate records.

lboekhorst avatar May 31 '16 06:05 lboekhorst

Fixed in master!

josevalim avatar Jun 01 '16 22:06 josevalim

Thanks, working!

lboekhorst avatar Jun 02 '16 12:06 lboekhorst