回答編集履歴
2
追記
test
CHANGED
@@ -31,3 +31,17 @@
|
|
31
31
|
`
|
32
32
|
|
33
33
|
かな
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
`def readable?(user)
|
40
|
+
|
41
|
+
user_id == user.id ||
|
42
|
+
|
43
|
+
(group_posts.map(&:group_id) & user.group_users.map(&:group_id)).present?
|
44
|
+
|
45
|
+
end`
|
46
|
+
|
47
|
+
ってのを作って `<% if @post.readable?(current_user) %>`ってします。
|
1
追記
test
CHANGED
@@ -19,3 +19,15 @@
|
|
19
19
|
という
|
20
20
|
|
21
21
|
もしかしたら無用な抵抗。
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
追記
|
26
|
+
|
27
|
+
`user_id == user.id ||
|
28
|
+
|
29
|
+
(group_posts.map(&:group_id) & user.group_users.map(&:group_id)).present?
|
30
|
+
|
31
|
+
`
|
32
|
+
|
33
|
+
かな
|