Skip to content

Commit 5534a22

Browse files
authored
Merge pull request rails#49740 from y-yagi/donot-use-deprecated-to_default_s
Don't use deprecated `#to_default_s` in `Date#to_fs`
2 parents 6f6c211 + bbe591d commit 5534a22

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def to_fs(format = :default)
5252
strftime(formatter)
5353
end
5454
else
55-
to_default_s
55+
to_s
5656
end
5757
end
5858
alias_method :to_formatted_s, :to_fs

activesupport/test/core_ext/date_ext_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_to_fs
3737
assert_equal "2005-02-21", date.to_fs(:inspect)
3838
assert_equal "21 Feb 2005", date.to_fs(:rfc822)
3939
assert_equal "2005-02-21", date.to_fs(:iso8601)
40+
assert_equal date.to_s, date.to_fs(:doesnt_exist)
4041
assert_equal "21 Feb", date.to_formatted_s(:short)
4142
end
4243

0 commit comments

Comments
 (0)