0

I'm looking for a solution to use many to many association in active model serializer.

Let's say I have a user with many user types through a many to many table, how can I return the user types for a specific user?

Do I need to create a serializer for the many to many model?

Xan
  • 74,770
  • 16
  • 179
  • 206
Dofs
  • 17,737
  • 28
  • 75
  • 123

1 Answers1

0

The answer was pretty stupid. I had set the serializer to "has_one user_type", a simple change to "has_many user_types" worked.

Dofs
  • 17,737
  • 28
  • 75
  • 123