Skip to content
This repository
Browse code

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 55d1d12.
  • Loading branch information...
commit bfafe8c4055bcb8dcf7440015d95a32c9773f40b 1 parent f8d3c72
Geoff Buesing gbuesing authored
2  activerecord/CHANGELOG
... ... @@ -1,7 +1,5 @@
1 1 *Edge*
2 2
3   -* 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]
4   -
5 3 * 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]
6 4
7 5 * SQLite: drop support for 'dbfile' option in favor of 'database.' #2363 [Paul Hinze, Jeremy Kemper]
2  activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -201,7 +201,7 @@ def fast_string_to_time(string)
201 201 end
202 202
203 203 def fallback_string_to_date(string)
204   - new_date(*::Date._parse(string, true).values_at(:year, :mon, :mday))
  204 + new_date(*::Date._parse(string, false).values_at(:year, :mon, :mday))
205 205 end
206 206
207 207 def fallback_string_to_time(string)
6 activerecord/test/cases/date_time_test.rb
@@ -34,10 +34,4 @@ def test_assign_empty_time
34 34 topic.bonus_time = ''
35 35 assert_nil topic.bonus_time
36 36 end
37   -
38   - def test_two_digit_year
39   - topic = Topic.new
40   - topic.last_read = '1/1/09'
41   - assert_equal Date.new(2009,1,1), topic.last_read
42   - end
43 37 end

0 comments on commit bfafe8c

Please sign in to comment.
Something went wrong with that request. Please try again.