ruby on rails - active_model_serializer many to many infinite loop -


is ruby's active_model_serializer (ams) able manage many many relations?

for example:

class projectserializer < activemodel::serializer     has_many :resources end  class resourcesserializer < activemodel::serializer     has_many :projects end 

i'm getting 'stack level deep' error.

reference issue on ams github repo: https://github.com/rails-api/active_model_serializers/issues/211

based on previous link think not supported yet, elegant workarounds welcome.

the reason error "stack level deep' infinite loop.

each resource list projects has in turn list resources have, list projects again , on.

you can use either 1 has_many not both.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -