This project is archived and is in readonly mode.
Fix before_type_cast for timezone aware datetime attributes
Reported by Adam Meehan | February 28th, 2011 @ 09:13 PM | in 3.0.6
The change made to allow timezone aware datetime attributes support before_type_cast function does not work correctly. The test for the change does not exercise the code because before the timezone_aware_attributes flag is not set to true for the model used in the test. This means the timezone aware write accessor is not created for the attribute used in the test. Instead, the default write accessor is created for this attribute which does not correctly handle the timezones.
This patch fixes the test and the code
See this ticket for more context.
https://rails.lighthouseapp.com/projects/8994/tickets/3973-before_t...
Comments and changes to this ticket
-
Adam Meehan March 1st, 2011 @ 11:14 AM
Reviewing this code and noticing a few comment about issues on the original commit from github, I realised the dup call on original_time is not necessary. There is no in-place modification of time to effect original_time.
New patch attached with this change.
-
Adam Meehan March 1st, 2011 @ 11:21 AM
Another change to remove the reload arg on the timezone aware attribute read method. This argument is undocumented, untested and breaks the before_type_cast behaviour if reload is attempted.
New patch combining all three changes.
-
Aaron Patterson March 1st, 2011 @ 04:34 PM
- State changed from new to open
- Milestone set to 3.0.6
- Assigned user set to Aaron Patterson
- Importance changed from to Low
-
Aaron Patterson March 23rd, 2011 @ 11:04 PM
- State changed from open to committed
Applied and pushed. Thanks!
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>