Side-loading objects with non-standard class names in EmberJS with Rails+active_model_serializers

前端 未结 3 1582
梦如初夏
梦如初夏 2021-02-09 08:21

I have a few models in Rails that look something like this:

class Issue < ActiveRecord::Base
  belongs_to :reporter, class_name: \'User\'
  belongs_to :assign         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-09 08:59

    I was having the same issue, adding include: false on the association did the trick for me.

        embed :ids, include: true
        attributes :id, :title
    
        has_many :domains, key: :domains, include: false
        has_many :sessions, key: :sessions
    

提交回复
热议问题