method

to_date

Importance_1
v2.2.1 - Show latest stable - 1 note - Class: ActiveSupport::CoreExtensions::DateTime::Conversions
to_date() public

Converts self to a Ruby <a href="/rails/Date">Date</a> object; time portion is discarded

Show source
Register or log in to add new notes.
February 4, 2009
0 thanks

usage example

code

class MyModel < ActiveRecord::Base
  def created_today?
    self.created_on.to_date == Date.today
  end
end