次のアクティブレコードモデルと1対1の関連付けがあります(例)。
User <-1-1-> employee <-1-1-> contact <-1-1->
permanentAddress contact <-1-1-> communicationAddress
ActiveRecordを使用してクエリが発生した場合:
User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", "49"]]
Employeedetail Load (1.8ms) SELECT "employeedetails".* FROM "employeedetails" WHERE "employeedetails"."User_id" = 49 LIMIT 1
Contactdetail Load (0.6ms) SELECT "contactdetails".* FROM "contactdetails" WHERE "contactdetails"."employeedetail_id" = 40 LIMIT 1
Address Load (1.1ms) SELECT "addresses".* FROM "addresses" WHERE "addresses"."contactdetail_id" = 52 LIMIT 1
CACHE (0.0ms) SELECT "addresses".* FROM "addresses" WHERE "addresses"."contactdetail_id" = 52 LIMIT 1
LIMIT
質問:住所テーブルのを2に増やす方法[inner association]
。