Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DateTime handling to attribute_to_time #717

Merged
merged 1 commit into from Nov 7, 2015
Merged

Add DateTime handling to attribute_to_time #717

merged 1 commit into from Nov 7, 2015

Commits on Nov 4, 2015

  1. Add DateTime handling to attribute_to_time

    This enhances `attribute_to_time` which previously removed all time
    information from a DateTime. This happened because DateTime identifies
    itself as a Date.
    
        2.2.3 :001 > require 'date'
         => true
        2.2.3 :002 > DateTime.now.is_a?(Date)
         => true
    
    Up to now, if `time.is_a?(Date)` is true, `attribute_to_time` will
    create a new Time, with just year, month and day set. To fix that
    behaviour, this commit adds a new condition at the beginning of
    `attribute_to_time`, which uses `time.to_time` as long as `time` is a
    DateTime.
    rosetree committed Nov 4, 2015
    Copy the full SHA
    6f268f4 View commit details
    Browse the repository at this point in the history