method

to_date

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 1 note - Class: ActiveSupport::CoreExtensions::DateTime::Conversions

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

These similar methods exist in v7.1.3.2:

to_date() public

Converts self to a Ruby Date 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