aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/date_time/compatibility.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add missing require for `remove_possible_method`Eugene Kenny2017-04-281-0/+1
| | | | | | https://github.com/rails/rails/commit/505537082849d912e8e29819655b80a573e93c0c added a call to `remove_possible_method`, but didn't require the file that defines it.
* Move `to_time` to `DateTime` compatibility.rb fileAndrew White2017-03-161-1/+11
| | | | | | We are overriding it in `Time` and `ActiveSupport::TimeWithZone` so there's no point in having it in the `DateAndTime::Compatibility` module. Also add some docs for the `to_time` implementations.
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Move `DateTime#getlocal` to `/core_ext/date_time/calculations.rb`yui-knk2016-04-231-11/+0
| | | | | | | | `DateTime#getlocal` is newly added public API. It's responsible is same as `DateTime#utc`, so `calculations.rb` is a best plase to define this method. For keeping consistency with `DateTime#utc`, defines `#localtime` and defines `getlocal` as an alias method.
* Add compatibility for Ruby 2.4 `to_time` changesAndrew White2016-04-231-0/+16
In Ruby 2.4 the `to_time` method for both `DateTime` and `Time` will preserve the timezone of the receiver when converting to an instance of `Time`. Since Rails 5.0 will support Ruby 2.2, 2.3 and later we need to introduce a compatibility layer so that apps that upgrade do not break. New apps will have a config initializer file that defaults to match the new Ruby 2.4 behavior going forward. For information about the changes to Ruby see: https://bugs.ruby-lang.org/issues/12189 https://bugs.ruby-lang.org/issues/12271 Fixes #24617.