Guest User

Untitled

a guest
Jul 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. scope :archives, select("DISTINCT(date_format(created_at,_utf8'%Y %M')) as year_and_month")
  2. scope :date_is, lambda {|period,date| where("#{period.to_s.upcase}(created_at) = ?", date)}
Add Comment
Please, Sign In to add comment