Project

General

Profile

Actions

Bug #15403

closed

Some methods of Date available in Ruby 2.5 are not available since r66329

Added by y-yagi (Yuji Yaginuma) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-12-12 trunk 66357) [x86_64-linux]
[ruby-core:90443]

Description

In r66329, some methods were moved to DateTime from Date.
This makes it not available to use methods that were available in Ruby 2.5, like hour.

It may not have been intentional that these methods could be used in Date. But Rails uses those methods in Date class.

https://github.com/rails/rails/blob/c4f37cc8c5a3b1de5746146a0f65b22d418cfef4/activesupport/lib/active_support/core_ext/date/calculations.rb#L11
https://github.com/rails/rails/blob/c4f37cc8c5a3b1de5746146a0f65b22d418cfef4/activesupport/lib/active_support/core_ext/date_and_time/calculations.rb#L378
(CI result: https://travis-ci.org/rails/rails/jobs/466863428#L6781-L6845 )

This affect to an old version of Rails too.
This seems incompatible changes. Is it not possible to make it deprecate rather than remove?

Updated by shevegen (Robert A. Heiler) over 5 years ago

This seems incompatible changes. Is it not possible to make it deprecate
rather than remove?

You are probably right there. I assume it may not have been intentional
for 2.6.x; perhaps not even to deprecate it but most certainly not for
removal.

In the last developer meeting a few hours ago, for example, matz approved
of Feature #10771 "An easy way to get the source location of a constant"
but it will come in 2.7 or later, not in 2.6:

https://docs.google.com/document/d/1q22gVRNbCIYOQw2djH4UPmT0gxVoBKvjvs0MqX5ILcU/edit

So I assume a similar reasoning applies to the change that you mentioned
here too; otherwise I assume the incompatibility would have been mentioned
in NEWS.

X-mas ruby releases also tend to be for stability; in particular nobu has
been fixing a lot of bugs lately, so I guess the situation here will also
probably be resolved before x-mas. :)

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66362.


Revise Date#hour, #min, #sec

For ActiveSupport. [ruby-core:90443] [Bug #15403]

Actions

Also available in: Atom PDF

Like0
Like0Like0