Programming Journal

学習したことの整理用です。

2020-10-21から1日間の記事一覧

【Rails】雑多なメモ

all_day 昨日作った記事だけ取得するscopeを作りたかったとき、Date.yesterdayやTime.current.yesterdayだと想定している挙動にならない… all_dayを使う! # NG scope :yesterday_published, -> { where(published_at: Date.yesterday) } # Good scope :yest…