質問編集履歴

2

コードの記述を修正しました

2016/09/28 23:56

投稿

kenny_sayama
kenny_sayama

スコア1036

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  this_month = Time.now.at_beginning_of_month
18
18
 
19
- to_this_month = this_month + 1.month - 1.day
19
+ to_this_month = this_month + 1.month
20
20
 
21
21
  @this_month = Post.where(user_id: @user.id, created_at: this_month...to_this_month).count
22
22
 
@@ -26,7 +26,7 @@
26
26
 
27
27
  last_month = this_month.last_month
28
28
 
29
- to_last_month = last_month + 1.month - 1.day
29
+ to_last_month = last_month + 1.month
30
30
 
31
31
  @last_month = Post.where(user_id: @user.id, created_at: last_month...to_last_month).count
32
32
 
@@ -36,7 +36,7 @@
36
36
 
37
37
  month_before_last = this_month.month_ago(2)
38
38
 
39
- to_month_before_last = month_before_last + 1.month - 1.day
39
+ to_month_before_last = month_before_last + 1.month
40
40
 
41
41
  @last_month = Post.where(user_id: @user.id, created_at: last_month...to_last_month).count
42
42
 

1

文字の修正

2016/09/28 23:56

投稿

kenny_sayama
kenny_sayama

スコア1036

test CHANGED
File without changes
test CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  to_this_month = this_month + 1.month - 1.day
20
20
 
21
- @this_month = Post.where(user_id: @user.id, status: 'answered', created_at: this_month...to_this_month).count
21
+ @this_month = Post.where(user_id: @user.id, created_at: this_month...to_this_month).count
22
22
 
23
23
 
24
24
 
@@ -28,7 +28,7 @@
28
28
 
29
29
  to_last_month = last_month + 1.month - 1.day
30
30
 
31
- @last_month = Post.where(user_id: @user.id, status: 'answered', created_at: last_month...to_last_month).count
31
+ @last_month = Post.where(user_id: @user.id, created_at: last_month...to_last_month).count
32
32
 
33
33
 
34
34
 
@@ -38,7 +38,7 @@
38
38
 
39
39
  to_month_before_last = month_before_last + 1.month - 1.day
40
40
 
41
- @last_month = Post.where(user_id: @user.id, status: 'answered', created_at: last_month...to_last_month).count
41
+ @last_month = Post.where(user_id: @user.id, created_at: last_month...to_last_month).count
42
42
 
43
43
  ```
44
44