aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/date_and_time_compatibility_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add `Style/RedundantFreeze` to remove redudant `.freeze`Yasuo Honda2018-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | Since Rails 6.0 will support Ruby 2.4.1 or higher `# frozen_string_literal: true` magic comment is enough to make string object frozen. This magic comment is enabled by `Style/FrozenStringLiteralComment` cop. * Exclude these files not to auto correct false positive `Regexp#freeze` - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333 Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed. * Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required - 'actionpack/test/controller/test_case_test.rb' - 'activemodel/test/cases/type/string_test.rb' - 'activesupport/lib/active_support/core_ext/string/strip.rb' - 'activesupport/test/core_ext/string_ext_test.rb' - 'railties/test/generators/actions_test.rb'
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Handle #to_time and memoization taking into account memoization, frozen ↵Kevin McPhillips2017-03-061-10/+156
| | | | state, and preserve_timezone flag.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* applies new string literal convention in activesupport/testXavier Noria2016-08-061-12/+12
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Make getlocal and getutc always return instances of TimeAndrew White2016-04-231-0/+17
| | | | | | | | | | | | | | | Previously these methods could return either a DateTime or a Time depending on how the ActiveSupport::TimeWithZone instance had been constructed. Changing to always return an instance of Time eliminates a possible stack level too deep error in to_time where it was wrapping a DateTime instance. As a consequence of this the internal time value is now always an instance of Time in the UTC timezone, whether that's as the UTC time directly or a representation of the local time in the timezone. There should be no consequences of this internal change and if there are it's a bug due to leaky abstractions.
* Add compatibility for Ruby 2.4 `to_time` changesAndrew White2016-04-231-0/+110
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.