Remove deprecated #to_default_s from Array, Date, DateTime and Time

This commit is contained in:
Rafael Mendonça França 2024-01-29 22:54:47 +00:00
parent c33e2d2e49
commit be211227a0
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
9 changed files with 6 additions and 31 deletions

@ -1,3 +1,7 @@
* Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
*Rafael Mendonça França*
* Remove deprecated support to passing `Dalli::Client` instances to `MemCacheStore`.
*Rafael Mendonça França*

@ -104,8 +104,6 @@ def to_fs(format = :default)
end
end
alias_method :to_formatted_s, :to_fs
alias_method :to_default_s, :to_s
deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
# Returns a string that represents the array in XML by invoking +to_xml+
# on each element. Active Record collections delegate their representation

@ -56,8 +56,6 @@ def to_fs(format = :default)
end
end
alias_method :to_formatted_s, :to_fs
alias_method :to_default_s, :to_s
deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
# Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005"
def readable_inspect

@ -40,10 +40,6 @@ def to_fs(format = :default)
end
end
alias_method :to_formatted_s, :to_fs
if instance_methods(false).include?(:to_s)
alias_method :to_default_s, :to_s
deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
end
# Returns a formatted string of the offset from UTC, or an alternative

@ -58,8 +58,6 @@ def to_fs(format = :default)
end
end
alias_method :to_formatted_s, :to_fs
alias_method :to_default_s, :to_s
deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
# Returns a formatted string of the offset from UTC, or an alternative
# string if the time zone is already UTC.

@ -21,13 +21,6 @@ def test_tomorrow_in_calendar_reform
assert_equal Date.new(1582, 10, 15), Date.new(1582, 10, 4).tomorrow
end
def test_to_default_s
date = Date.new(2005, 2, 21)
assert_deprecated(ActiveSupport.deprecator) do
assert_equal "2005-02-21", date.to_default_s
end
end
def test_to_fs
date = Date.new(2005, 2, 21)
assert_equal "21 Feb", date.to_fs(:short)

@ -13,13 +13,6 @@ def date_time_init(year, month, day, hour, minute, second, usec = 0)
include DateAndTimeBehavior
include TimeZoneTestHelpers
def test_to_default_s
datetime = DateTime.new(2005, 2, 21, 14, 30, 0, 0)
assert_deprecated(ActiveSupport.deprecator) do
assert_match(/^2005-02-21T14:30:00(Z|\+00:00)$/, datetime.to_default_s)
end
end
def test_to_fs
datetime = DateTime.new(2005, 2, 21, 14, 30, 0, 0)
assert_equal "2005-02-21 14:30:00", datetime.to_fs(:db)

@ -819,13 +819,6 @@ def test_next_week_near_daylight_end
end
end
def test_to_default_s
time = Time.utc(2005, 2, 21, 17, 44, 30.12345678901)
assert_deprecated(ActiveSupport.deprecator) do
assert_equal time.to_default_s, time.to_s
end
end
def test_to_fs
time = Time.utc(2005, 2, 21, 17, 44, 30.12345678901)
assert_equal time.to_s, time.to_fs(:doesnt_exist)

@ -207,6 +207,8 @@ Please refer to the [Changelog][active-support] for detailed changes.
### Removals
* Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
* Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.
* Remove deprecated support for `config.active_support.cache_format_version = 6.1`.