Ember.js 多侧面加载

Ember.js 多侧面加载,ember.js,ember-data,active-model-serializers,Ember.js,Ember Data,Active Model Serializers,我使用ActiveModel::Serializers将JSON输出到Ember.js应用程序。我使用侧加载来最大化性能 我可以告诉ActiveModel::Serializers将交换机序列化程序中的所有电话号码侧向加载吗 交换机\u序列化程序.rb class SwitchboardSerializer < ActiveModel::Serializer embed :ids, :include => true attributes :id, :name has_m

我使用
ActiveModel::Serializers
将JSON输出到Ember.js应用程序。我使用侧加载来最大化性能

我可以告诉
ActiveModel::Serializers
交换机序列化程序中的所有
电话号码
侧向加载吗

交换机\u序列化程序.rb

class SwitchboardSerializer < ActiveModel::Serializer
  embed :ids, :include => true

  attributes :id, :name
  has_many :switchboard_entries
  has_many :sip_accounts, :through => :switchboard_entries
end
class SipAccountSerializer < ActiveModel::Serializer
  embed :ids, :include => true

  attributes :id, :auth_name, :caller_name, :sip_accountable_id
  has_many :phone_numbers
end
class SwitchboardSerializertrue
属性:id,:name
有许多:交换机条目
拥有多个:sip\u帐户,:至=>:交换机\u条目
结束
sip\u account\u serializer.rb

class SwitchboardSerializer < ActiveModel::Serializer
  embed :ids, :include => true

  attributes :id, :name
  has_many :switchboard_entries
  has_many :sip_accounts, :through => :switchboard_entries
end
class SipAccountSerializer < ActiveModel::Serializer
  embed :ids, :include => true

  attributes :id, :auth_name, :caller_name, :sip_accountable_id
  has_many :phone_numbers
end
class SipAccountSerializertrue
属性:id、:auth\u name、:caller\u name、:sip\u id
有很多电话号码吗
结束

通过在
应用程序/模型/交换机中添加
has\u many:phone\u number,:through=>:sip\u accounts
rb
我能够在
交换机序列化程序中使用
has\u many:phone\u number