aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2009-08-05 08:19:21 -0500
committerGeoff Buesing <gbuesing@gmail.com>2009-08-05 08:26:12 -0500
commitbfafe8c4055bcb8dcf7440015d95a32c9773f40b (patch)
tree62696a6bf79a4c451646dbc8d115987085cbe5cb /activerecord
parentf8d3c72c39ad209abca7f3613f91fb3a03805261 (diff)
downloadrails-bfafe8c4055bcb8dcf7440015d95a32c9773f40b.tar.gz
rails-bfafe8c4055bcb8dcf7440015d95a32c9773f40b.tar.bz2
rails-bfafe8c4055bcb8dcf7440015d95a32c9773f40b.zip
Revert "fallback_string_to_date sets Date._parse comp arg to true, so that strings with two-digit years, e.g. '1/1/09', are interpreted as modern years" [#2019 state:wontfix]
This reverts commit 55d1d12c32a1b99f3f07d2346b49a63650ba2e9d.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb2
-rw-r--r--activerecord/test/cases/date_time_test.rb6
3 files changed, 1 insertions, 9 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 3f350be3e9..9adc6b887f 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,7 +1,5 @@
*Edge*
-* fallback_string_to_date sets Date._parse comp arg to true, so that strings with two-digit years, e.g. '1/1/09', are interpreted as modern years #2019 [Matt Ganderup]
-
* quoted_date converts time-like objects to ActiveRecord::Base.default_timezone before serialization. This allows you to use Time.now in find conditions and have it correctly be serialized as the current time in UTC when default_timezone == :utc. #2946 [Geoff Buesing]
* SQLite: drop support for 'dbfile' option in favor of 'database.' #2363 [Paul Hinze, Jeremy Kemper]
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index f4e8fe6a38..24c734cddb 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -201,7 +201,7 @@ module ActiveRecord
end
def fallback_string_to_date(string)
- new_date(*::Date._parse(string, true).values_at(:year, :mon, :mday))
+ new_date(*::Date._parse(string, false).values_at(:year, :mon, :mday))
end
def fallback_string_to_time(string)
diff --git a/activerecord/test/cases/date_time_test.rb b/activerecord/test/cases/date_time_test.rb
index f7527c0c04..36e1caa0b6 100644
--- a/activerecord/test/cases/date_time_test.rb
+++ b/activerecord/test/cases/date_time_test.rb
@@ -34,10 +34,4 @@ class DateTimeTest < ActiveRecord::TestCase
topic.bonus_time = ''
assert_nil topic.bonus_time
end
-
- def test_two_digit_year
- topic = Topic.new
- topic.last_read = '1/1/09'
- assert_equal Date.new(2009,1,1), topic.last_read
- end
end