回答編集履歴
1
fix error
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
``` ruby
|
2
|
+
@users = User.where(
|
2
|
-
|
3
|
+
prefecture_id: @current_user.prefecture_id,
|
3
|
-
.where('users.birthday between ? and ?',
|
4
|
-
|
4
|
+
birthday: (current_user.birthday - 3.year .. current_user.birthday + 3.year
|
5
|
-
|
5
|
+
).order("RANDOM()").limit(10)
|
6
6
|
```
|