2013-04-05から1日間の記事一覧
ActiveSupportのコア拡張を使うとめちゃ綺麗に書けて感動した。 今日 from = Time.now.at_beginning_of_day to = from + 1.day items = Item.where(created_at: from...to).order(created_at: :desc) 今月 from = Time.now.at_beginning_of_month to = from …
ActiveSupportのコア拡張を使うとめちゃ綺麗に書けて感動した。 今日 from = Time.now.at_beginning_of_day to = from + 1.day items = Item.where(created_at: from...to).order(created_at: :desc) 今月 from = Time.now.at_beginning_of_month to = from …