回答編集履歴
1
このままではだめでした。コード修正が必要です。
test
CHANGED
@@ -6,6 +6,16 @@
|
|
6
6
|
|
7
7
|
なのでuser_idを主キーにしているのであればProfileモデルでprimaryKeyの設定をしてやる必要があります。
|
8
8
|
|
9
|
-
Profile.phpにpublic $primaryKey = 'user_id';を追加すると明示的に主キーのカラムを設定でき
|
9
|
+
Profile.phpにpublic $primaryKey = 'user_id';を追加すると明示的に主キーのカラムを設定できます。
|
10
|
+
|
11
|
+
その上で
|
12
|
+
|
13
|
+
$this->Profile->user_id = $user;
|
14
|
+
|
15
|
+
となっているところを
|
16
|
+
|
17
|
+
$this->Profile->id = $user;
|
18
|
+
|
19
|
+
に変更してください。
|
10
20
|
|
11
21
|
[CakePHP primaryKey](http://book.cakephp.org/2.0/ja/models/model-attributes.html#primarykey)
|