- 21 1月, 2019 1 次提交
-
-
由 Andrew White 提交于
When assigning a hash to a time attribute that's missing a year component (e.g. a `time_select` with `:ignore_date` set to `true`) then the year defaults to 1970 instead of the expected 2000. This results in the attribute changing as a result of the save. Before: event = Event.new(start_time: { 4 => 20, 5 => 30 }) event.start_time # => 1970-01-01 20:30:00 UTC event.save event.reload event.start_time # => 2000-01-01 20:30:00 UTC After: event = Event.new(start_time: { 4 => 20, 5 => 30 }) event.start_time # => 2000-01-01 20:30:00 UTC event.save event.reload event.start_time # => 2000-01-01 20:30:00 UTC
-
- 17 5月, 2018 1 次提交
-
-
由 Annie-Claude Côté 提交于
Before it was coercing an invalid string into "2000-01-01 00:00:00".
-
- 12 3月, 2018 2 次提交
-
-
由 Andrew White 提交于
For legacy reasons Rails stores time columns on sqlite as full timestamp strings. However because the date component wasn't being normalized this meant that when they were read back they were being prefixed with 2001-01-01 by ActiveModel::Type::Time. This had a twofold result - first it meant that the fast code path wasn't being used because the string was invalid and second it was corrupting the second fractional component being read by the Date._parse code path. Fix this by a combination of normalizing the timestamps on writing and also changing Active Model to be more lenient when detecting whether a string starts with a date component before creating the dummy time value for parsing.
-
由 Andrew White 提交于
In #20317, datetime columns had their precision applied on assignment but that behaviour wasn't applied to time columns - this commit fixes that. Fixes #30301.
-
- 17 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 02 7月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 07 8月, 2016 2 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 25 7月, 2016 1 次提交
-
-
由 Xavier Noria 提交于
-
- 05 1月, 2016 1 次提交
-
-
由 Andrey Novikov 提交于
-
- 01 12月, 2015 1 次提交
-
-
由 Yasuo Honda 提交于
-
- 22 9月, 2015 1 次提交
-
-
由 Kir Shatrov 提交于
The first step of bringing typecasting to ActiveModel
-
- 08 2月, 2015 2 次提交
-
-
由 Sean Griffin 提交于
The type code is actually quite accessible, and I'm planning to encourage people to look at the files in the `type` folder to learn more about how it works. This will help reduce the noise from code that is less about type casting, and more about random AR nonsense.
-
由 Sean Griffin 提交于
This allows us to remove `Type::Value#klass`, as it was only used for multi-parameter assignment to reach into the types internals. The relevant type objects now accept a hash in addition to their previous accepted arguments to `type_cast_from_user`. This required minor modifications to the tests, since previously they were relying on the fact that mulit-parameter assignement was reaching into the internals of time zone aware attributes. In reaility, changing those properties at runtime wouldn't change the accessor methods for all other forms of assignment.
-
- 15 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
The types that are affected by `time_zone_aware_attributes` (which is on by default) have been made configurable, in case this is a breaking change for existing applications.
-
- 28 5月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
`ActiveRecord::ConnectionAdapters::Type::Value` => `ActiveRecord::Type::Value`
-