回答編集履歴

1

fix error

2020/09/15 08:35

投稿

tomtdhzz
tomtdhzz

スコア10

test CHANGED
@@ -1,11 +1,11 @@
1
1
  ``` ruby
2
2
 
3
- @user = User.where(prefecture_id: @current_user.prefecture_id)
3
+ @users = User.where(
4
4
 
5
- .where('users.birthday between ? and ?',
5
+ prefecture_id: @current_user.prefecture_id,
6
6
 
7
- @current_user.birthday - 3.years, @current_user.birthday + 3.years)
7
+ birthday: (current_user.birthday - 3.year .. current_user.birthday + 3.year
8
8
 
9
- .order("RANDOM()").limit(10)
9
+ ).order("RANDOM()").limit(10)
10
10
 
11
11
  ```