質問編集履歴
1
例文修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
```
|
2
|
-
|
3
|
-
u1 = User.first
|
4
2
|
|
5
3
|
|
6
4
|
|
5
|
+
|
6
|
+
|
7
|
-
u2 = User.
|
7
|
+
u2 = User.where(id: 10)
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
u3 = User.where(id > 10)
|
11
|
+
u3 = User.organizations.where(id > 10)
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
u
|
15
|
+
u2 + u3 #error
|
16
16
|
|
17
17
|
```
|
18
18
|
|
@@ -36,9 +36,9 @@
|
|
36
36
|
|
37
37
|
def index
|
38
38
|
|
39
|
-
@user_list = current_user.where(id > 10) #通常はこれを出す
|
39
|
+
@user_list = current_user.organizatons.where(id > 10) #通常はこれを出す
|
40
40
|
|
41
|
-
@private_user_list = User.
|
41
|
+
@private_user_list = User.where(status: 1) if current_user.is_admin? #adminの場合、あるクエリを足したい
|
42
42
|
|
43
43
|
|
44
44
|
|