user.as_json(
include: [
user_purchased_packages: {
include: [
business_package: {
include: [
business: {
include: :business_address
},
package: {
include: :services
}
]
}
]
}
]
)
当我传入数组
[:business=>{:include=>:business_address},:package=>{:include=>:services}]
因此,期望业务和包装两个对象值都应该到来。
但我只能获得业务对象,而包对象不会到来。
答案 0 :(得分:0)
user.as_json(包括:{:user_bookings => {include:[:business_category_service_sub_services,:business => {include :: business_address}],方法:[:date_format]},:user_purchased_packages => {: include => [:business_package => {:include => {:package => {include :::services},:business => {include :: business_address}}}],方法:[:date_format]方法:[:followers_count,:following_count,:full_name])