質問編集履歴
1
context[:current_resource]に変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
current_u
|
1
|
+
context[:current_resource]が使えないなぜ?(undefined local variable or method `current_user')
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
graphql-deviseを導入していますが、下記のよう設定をしてもcurrent_u
|
1
|
+
graphql-deviseを導入していますが、下記のよう設定をしてもcontext[:current_resource]を使えません
|
2
2
|
|
3
3
|
なぜでしょうか・
|
4
4
|
|
@@ -120,6 +120,8 @@
|
|
120
120
|
|
121
121
|
def update!
|
122
122
|
|
123
|
+
current_user = context[:current_resource]
|
124
|
+
|
123
125
|
current_user.assign_attributes(first_name: first_name, last_name: last_name, image: valid_image)
|
124
126
|
|
125
127
|
current_user.update
|