From fa674cf7230e40bc96625ee97a6057e48bb20f0f Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 15 Nov 2021 11:37:40 +0100 Subject: [ruby/date] `Date._(nil)` should return an empty Hash Fix: https://github.com/ruby/date/issues/39 This is how versions previous to 3.2.1 behaved and Active Support currently rely on this behavior. https://github.com/rails/rails/blob/90357af08048ef5076730505f6e7b14a81f33d0c/activesupport/lib/active_support/values/time_zone.rb#L383-L384 Any Rails application upgrading to date `3.2.1` might run into unexpected errors. https://github.com/ruby/date/commit/8f2d7a0c7e --- ext/date/date_core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/date/date_core.c') diff --git a/ext/date/date_core.c b/ext/date/date_core.c index e372a12cd7..d1d03fe407 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -4342,6 +4342,8 @@ get_limit(VALUE opt) static void check_limit(VALUE str, VALUE opt) { + if (NIL_P(str)) return; + StringValue(str); size_t slen = RSTRING_LEN(str); size_t limit = get_limit(opt); -- cgit v1.2.3