Hey, how do I set a scope in rails 3 to todays records?
This doent work, yet. I get no data.
class MyModel < ActiveRecord::Base scope :today, :con
I know that is a old question, but still can help anyone.
This was my way to solve this:
scope :today, -> { where(created_at: DateTime.now.beginning_of_day..DateTime.now.end_of_day) }