質問編集履歴
1
インデント修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,10 +2,9 @@
|
|
2
2
|
```
|
3
3
|
def exam_items
|
4
4
|
item_ids = []
|
5
|
-
|
5
|
+
items.each do |item|
|
6
|
-
|
6
|
+
if item.has_exam? # itemモデルで定義した、true or falseを返すメソッド
|
7
|
-
|
7
|
+
item_ids << item.id
|
8
|
-
end
|
9
8
|
end
|
10
9
|
end
|
11
10
|
Item.where(id: item_ids.uniq)
|