2013-12-08から1日間の記事一覧
DBから期間で絞り込んでwhereで取り出す方法。 よく紹介されているのが以下のような書き方。 from = Date.today.beginning_of_month to = Date.today.end_of_month sample = Sample.where(created_at: from...to ) Sampleテーブルから、created_atの日付が今…
DBから期間で絞り込んでwhereで取り出す方法。 よく紹介されているのが以下のような書き方。 from = Date.today.beginning_of_month to = Date.today.end_of_month sample = Sample.where(created_at: from...to ) Sampleテーブルから、created_atの日付が今…