This project is archived and is in readonly mode.
ActiveRecord DateTime, Time Mappings
-
Frederick Cheung
Ruby does not have a pure time of day class so :time maps to the Time class. Date columns already map to Date. As far as DateTime goes, it's a lot slower to work with than Time (since Time is just an integer offset from an epoch). These days Rails does fall back from Time to DateTime if a row contains a date not representable by Time.
It does seem a bit broken to me that pure times of day are represented as datetimes with an arbitrary year/month/day prefix. It shouldn't be hard to change the serialization code, although I would be concerned about the backwards compatibility implications of that (it does look like someone explicitly chose to handle time columns in the same way as datetime columns though)
-
Pratik
- Assigned user set to Frederick Cheung
-
Santiago Pastorino
- State changed from new to open
- Importance changed from to
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale