1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/lib/active_model
Andrew White 3f95054f1c Normalize date component when writing to time columns
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.
2018-03-11 18:30:07 +00:00
..
attribute Active Model: Use private attr_reader 2018-02-26 06:16:24 +09:00
attribute_set Active Model: Use private attr_reader 2018-02-26 06:16:24 +09:00
locale
serializers
type Normalize date component when writing to time columns 2018-03-11 18:30:07 +00:00
validations Rails 6 requires Ruby 2.3+ 2018-02-17 10:03:37 -08:00
attribute.rb Active Model: Use private attr_reader 2018-02-26 06:16:24 +09:00
attribute_assignment.rb Alias assign_attributes to attributes= for AttributeAssignment 2018-02-28 19:58:45 +09:00
attribute_methods.rb
attribute_mutation_tracker.rb Revert "PERF: Recover changes_applied performance (#31698)" 2018-03-06 15:11:22 -07:00
attribute_set.rb deep_dup is used in AttributeSet#deep_dup 2018-01-13 13:09:31 +09:00
attributes.rb Ruby 2.4: take advantage of String#unpack1 2018-03-01 22:42:51 -08:00
callbacks.rb Use tt in doc for ActiveRecord [ci skip] 2017-08-27 14:01:29 +09:00
conversion.rb
dirty.rb Don't call changes in changes_applied unless required 2018-03-06 15:11:23 -07:00
errors.rb fix bug on added? method 2017-11-13 17:27:47 +01:00
forbidden_attributes_protection.rb
gem_version.rb Start Rails 6.0 development!!! 2018-01-30 18:51:17 -05:00
lint.rb Use respond_to test helpers 2018-01-25 23:32:58 -05:00
model.rb
naming.rb Clarify intentions around method redefinitions 2017-09-01 14:27:13 +09:30
railtie.rb
secure_password.rb
serialization.rb Merge pull request #28270 from mmangino/dont_ignore_seralization_options 2018-02-27 23:42:15 +09:00
translation.rb
type.rb Fix doc typo [ci skip] 2017-12-12 16:34:19 -05:00
validations.rb Refactor to Array(options[:on]) only once in defining validations 2018-01-01 06:18:39 +09:00
validator.rb
version.rb