Skip to content

Commit be21122

Browse files
committed
Remove deprecated #to_default_s from Array, Date, DateTime and Time
1 parent c33e2d2 commit be21122

File tree

9 files changed

+6
-31
lines changed

9 files changed

+6
-31
lines changed

activesupport/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
2+
3+
*Rafael Mendonça França*
4+
15
* Remove deprecated support to passing `Dalli::Client` instances to `MemCacheStore`.
26

37
*Rafael Mendonça França*

activesupport/lib/active_support/core_ext/array/conversions.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ def to_fs(format = :default)
104104
end
105105
end
106106
alias_method :to_formatted_s, :to_fs
107-
alias_method :to_default_s, :to_s
108-
deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
109107

110108
# Returns a string that represents the array in XML by invoking +to_xml+
111109
# on each element. Active Record collections delegate their representation

activesupport/lib/active_support/core_ext/date/conversions.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ def to_fs(format = :default)
5656
end
5757
end
5858
alias_method :to_formatted_s, :to_fs
59-
alias_method :to_default_s, :to_s
60-
deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
6159

6260
# Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005"
6361
def readable_inspect

activesupport/lib/active_support/core_ext/date_time/conversions.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ def to_fs(format = :default)
4040
end
4141
end
4242
alias_method :to_formatted_s, :to_fs
43-
if instance_methods(false).include?(:to_s)
44-
alias_method :to_default_s, :to_s
45-
deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
46-
end
4743

4844

4945
# Returns a formatted string of the offset from UTC, or an alternative

activesupport/lib/active_support/core_ext/time/conversions.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ def to_fs(format = :default)
5858
end
5959
end
6060
alias_method :to_formatted_s, :to_fs
61-
alias_method :to_default_s, :to_s
62-
deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
6361

6462
# Returns a formatted string of the offset from UTC, or an alternative
6563
# string if the time zone is already UTC.

activesupport/test/core_ext/date_ext_test.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ def test_tomorrow_in_calendar_reform
2121
assert_equal Date.new(1582, 10, 15), Date.new(1582, 10, 4).tomorrow
2222
end
2323

24-
def test_to_default_s
25-
date = Date.new(2005, 2, 21)
26-
assert_deprecated(ActiveSupport.deprecator) do
27-
assert_equal "2005-02-21", date.to_default_s
28-
end
29-
end
30-
3124
def test_to_fs
3225
date = Date.new(2005, 2, 21)
3326
assert_equal "21 Feb", date.to_fs(:short)

activesupport/test/core_ext/date_time_ext_test.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ def date_time_init(year, month, day, hour, minute, second, usec = 0)
1313
include DateAndTimeBehavior
1414
include TimeZoneTestHelpers
1515

16-
def test_to_default_s
17-
datetime = DateTime.new(2005, 2, 21, 14, 30, 0, 0)
18-
assert_deprecated(ActiveSupport.deprecator) do
19-
assert_match(/^2005-02-21T14:30:00(Z|\+00:00)$/, datetime.to_default_s)
20-
end
21-
end
22-
2316
def test_to_fs
2417
datetime = DateTime.new(2005, 2, 21, 14, 30, 0, 0)
2518
assert_equal "2005-02-21 14:30:00", datetime.to_fs(:db)

activesupport/test/core_ext/time_ext_test.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -819,13 +819,6 @@ def test_next_week_near_daylight_end
819819
end
820820
end
821821

822-
def test_to_default_s
823-
time = Time.utc(2005, 2, 21, 17, 44, 30.12345678901)
824-
assert_deprecated(ActiveSupport.deprecator) do
825-
assert_equal time.to_default_s, time.to_s
826-
end
827-
end
828-
829822
def test_to_fs
830823
time = Time.utc(2005, 2, 21, 17, 44, 30.12345678901)
831824
assert_equal time.to_s, time.to_fs(:doesnt_exist)

guides/source/7_2_release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ Please refer to the [Changelog][active-support] for detailed changes.
207207

208208
### Removals
209209

210+
* Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
211+
210212
* Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.
211213

212214
* Remove deprecated support for `config.active_support.cache_format_version = 6.1`.

0 commit comments

Comments
 (0)