Skip to content

Commit cf35b17

Browse files
Trimecharp
andauthored
use native rails way to compute 7 days ago
Co-authored-by: echarp <[email protected]>
1 parent 49f2c76 commit cf35b17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/comment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Comment < ActiveRecord::Base
4040
select([:id, :node_id, :title])
4141
}
4242
scope :latest, -> {
43-
where(["created_at >= ?", Date.current - 7.day])
43+
where(["created_at >= ?", 7.days.ago])
4444
}
4545

4646
paginates_per 50

0 commit comments

Comments
 (0)