class Model scope :this_month,-> { where(created_at: Time.Now.beginning_of_month..Time.Now.end_of_month) } end
你可以这样称呼:
Model.this_month