aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Fix safe_constantize to not raise a LoadError.Keenan Brock2019-01-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Summary There was an issues when using `safe_constantize` on a string that has the wrong case. File `em.rb` defines `EM`. `"Em".safe_constantize` causes a little confusion with the autoloader. The autoloader finds file "em.rb", expecting it to define `Em`, but `Em` is not defined. The autoloader raises a `LoadError`, which is good, But `safe_constantize` is defined to return `nil` when a class is not found. ### Before ``` "Em".safe_constantize LoadError: Unable to autoload constant Em, \ expected rails/activesupport/test/autoloading_fixtures/em.rb to define it ``` ### After ``` "Em".safe_constantize # => nil ```
* Merge pull request #34700 from gmcgibbon/fetch_multi_key_orderRafael França2019-01-071-0/+6
|\ | | | | Preserve key order of #fetch_multi
| * Preserve key order passed to ActiveSupport::CacheStore#fetch_multiGannon McGibbon2018-12-271-0/+6
| | | | | | | | | | | | fetch_multi(*names) now returns its results in the same order as the `*names` requested, rather than returning cache hits followed by cache misses.
* | Require Ruby 2.5 for Rails 6.Kasper Timm Hansen2018-12-191-2/+2
|/ | | | | | | | | | Generally followed the pattern for https://github.com/rails/rails/pull/32034 * Removes needless CI configs for 2.4 * Targets 2.5 in rubocop * Updates existing CHANGELOG entries for fewer merge conflicts * Removes Hash#slice extension as that's inlined on Ruby 2.5. * Removes the need for send on define_method in MethodCallAssertions.
* Do nothing when the same block is included again.Mark J. Titorenko2018-11-291-0/+4
| | | | | | | | | If the same block is included multiple times, we no longer raise an exception or overwrite the included block instance variable. Fixes #14802. [Mark J. Titorenko + Vlad Bokov]
* Make #to_options an alias for #symbolize_keysNick Weiland2018-11-011-0/+5
| | | | | | | | | | | | Fixes #34359 Prior to 5.2.0 (2cad8d7), HashWithIndifferentAccess#to_options acted as an alias to HashWithIndifferentAccess#symbolize_keys. Now, #to_options returns an instance of HashWithIndifferentAccess while #symbolize_keys returns and instance of Hash. This pr makes it so HashWithIndifferentAccess#to_options acts as an alias for HashWithIndifferentAccess#symbolize_keys once again.
* Registers e302725 in the CHANGELOG [ci skip]Xavier Noria2018-10-281-0/+4
| | | | References #34253.
* Deprecate Unicode's #pack_graphemes and #unpack_graphemes methodsFrancesco Rodríguez2018-10-181-0/+5
| | | | in favor of `array.flatten.pack("U*")` and `string.scan(/\X/).map(&:codepoints)`, respectively.
* Deprecate ActiveSupport::Multibyte::Chars.consumes?Francesco Rodríguez2018-10-151-0/+4
| | | | | | In favor of String#is_utf8?. I think this method was made for internal use only, and its usage was removed here: https://github.com/rails/rails/pull/8261/files#diff-ce956ebe93786930e40f18db1da5fd46L39.
* Fix issue where duration where always rounded up to a second:Edouard CHIN2018-10-121-0/+9
| | | | | | | | | | | | | | | | | | | | - Adding a Float as a duration to a datetime would result in the Float being rounded. Doing something like would have no effect because the 0.45 seconds would be rounded to 0 second. ```ruby time = DateTime.parse("2018-1-1") time += 0.45.seconds ``` This behavior was intentionally added a very long time ago, the reason was because Ruby 1.8 was using `Integer#gcd` in the constructor of Rational which didn't accept a float value. That's no longer the case and doing `Rational(0.45, 86400)` would now perfectly work fine. - Fixes #34008
* Deprecate Unicode#normalize and Chars#normalize (#34202)Francesco Rodríguez2018-10-121-0/+5
|
* Deprecate Unicode#downcase/upcase/swapcase.Francesco Rodríguez2018-10-121-0/+5
| | | | Use String methods directly instead.
* Deprecate ActionDispatch::Http::ParameterFilter in favor of ↵Yoshiyuki Kinjo2018-10-081-0/+4
| | | | ActiveSupport::ParameterFilter
* Merge pull request #34051 from gmcgibbon/module_parent_method_renameRafael Mendonça França2018-10-021-0/+5
|\ | | | | | | Prefix Module#parent, Module#parents, and Module#parent_name with module
| * Prefix Module#parent, Module#parents, and Module#parent_name with moduleGannon McGibbon2018-10-021-0/+5
| |
* | Deprecate the `LoggerSilence` constant:Edouard CHIN2018-10-021-0/+4
|/ | | | | | | | - I found this weird that the LoggerSilence wasn't using the `ActiveSupport` namespace (AFAIK all other classes have it). This PR deprecate the use of `LoggerSilence` for `ActiveSupport::LoggerSilence` instead.
* Add deprecation warning when String#first and String#last receive negative ↵Gannon McGibbon2018-09-281-0/+4
| | | | | | integers [Gannon McGibbon + Eric Turner]
* Fix HashWithIndifferentAccess#without bugAbraham Chan2018-09-281-0/+5
|
* Handle more unsafe String methods (#33990)Janosch Müller2018-09-271-0/+5
| | | | | | | | | | * Handle more unsafe String methods * Fix codeclimate issue * Revert stylistic change [Janosch Müller + Rafael Mendonça França]
* Merge pull request #27792 from tjoyal/sandbox-tagged-loggingRafael Mendonça França2018-09-111-0/+5
|\ | | | | | | TaggedLogging to return a new logger instance
| * TaggedLogging to return a new logger instanceThierry Joyal2017-02-271-0/+4
| |
* | Add #unfreeze_time to ActiveSupport::Testing::TimeHelpersryanwhocodes2018-09-101-0/+6
| |
* | reflect c03bba4 in CHANGELOGsXavier Noria2018-09-081-0/+9
| |
* | Formatting CHANGELOGs [ci skip]Ryuta Kamizono2018-09-071-4/+4
| | | | | | | | Fixing code block rendering, indentation, backticks, etc.
* | Update CHANGELOG for SafetyBuffer slice accessYumin Wong2018-09-061-0/+7
| | | | | | | | Co-authored-by: no-itsbackpack <no-itsbackpack@github.com>
* | Add `Array#extract!`bogdanvlviv2018-08-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | The method removes and returns the elements for which the block returns a true value. If no block is given, an Enumerator is returned instead. ``` numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9] numbers # => [0, 2, 4, 6, 8] ```
* | Fix a typo in Active Support's CHANGELOG [ci skip]Robin Dupret2018-08-101-1/+1
| |
* | Move changelog entry of 47018a82 up [ci skip]bogdanvlviv2018-08-051-11/+11
| | | | | | | | | | | | | | We always add new entries on the top of changelog file. This commit moves the entry added in 47018a82 up in order to preserve the chronology. Follows up 3e2629eb7fae33cd521bf1c265d1bbe8ed04c59e
* | Support skip nil for cache fetch (#25437)Martin2018-08-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | * test case for fetch cache miss with skip_nil * abondon nil cache if skip_nil specified * ensure not cache key for skip nil * add document with skip_nil for Store#fetch * add a new change log entry for #25437
* | I cannot spellAaron Patterson2018-07-261-1/+1
| |
* | Add changelog entryAaron Patterson2018-07-261-0/+34
| |
* | Add cpu_time, idle_time, and allocations to EventEileen Uchitelle2018-07-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use process clock instead of Time.now This fixes any issues with the system clock changing and also eliminates 2 object allocations per event. * Add start! and finish! methods to the event object so we can record more information * Adds cpu time, idle time, and allocation count for a particular event. Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com>
* | Refactor #33254.Kasper Timm Hansen2018-07-011-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Firstly, increment and decrement shouldn't care about the particulars of key expiry. They should only know that they have to pass that responsibility on to somewhere else. Secondly, it moves the key normalization back inside the instrumentation like it was originally. I think that matches the original design intention or at the very least it lets users catch haywire key truncation. Thirdly, it moves the changelog entry to the top of the file, where new entries go. I couldn't understand what the entry was saying so I tried to rewrite it.
* | Add :expires_in option support for RedisCacheStore increment/decrement method.Jason Lee2018-06-291-0/+11
| |
* | [ci skip] "brethen" is misspelled and unclearMichael Gee2018-05-311-1/+1
| |
* | add CHANGELOG/Docutilum2018-05-221-0/+11
| |
* | [ci skip] Add documentation/changelog entry.Kasper Timm Hansen2018-05-211-0/+15
| |
* | Fix typo in constant name [ci skip]yuuji.yaginuma2018-04-221-1/+1
| |
* | Merge pull request #32168 from christianblais/activesupport-ordinalize-i18nRafael França2018-04-191-0/+28
|\ \ | | | | | | `#ordinal` and `#ordinalize` now support I18n
| * | `ActiveSupport::Inflector#ordinal` and `ActiveSupport::Inflector#ordinalize`Christian Blais2018-03-051-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now support translations through I18n. { fr: { number: { nth: { ordinals: lambda do |_key, number:, **_options| if number.to_i.abs == 1 'er' else 'e' end end, ordinalized: lambda do |_key, number:, **_options| "#{number}#{ActiveSupport::Inflector.ordinal(number)}" end } } } }
* | | Merge branch 'master' into fix-as-timezone-allAndrew White2018-04-191-0/+5
|\ \ \
| * | | Redis cache store: avoid blocking the server in `#delete_matched`Gleb Mazovetskiy2018-04-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #32610. Closes #32614. Lua scripts in redis are *blocking*, meaning that no other client can execute any commands while the script is running. See https://redis.io/commands/eval#atomicity-of-scripts. This results in the following exceptions once the number of keys is sufficiently large: BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE. This commit replaces the lua-based implementation with one that uses `SCAN` and `DEL` in batches. This doesn't block the server. The primary limitation of `SCAN`, i.e. potential duplicate keys, is of no consequence here, because `DEL` ignores keys that do not exist.
* | | | Fix exception in AS::Timezone.all when any tzinfo data is missingDominik Sander2018-04-181-0/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change missing timezone data for any of the time zones defined in `ActiveSupport::Timezone::MAPPING` caused a `comparison of NilClass with ActiveSupport::TimeZone failed` exception. Attempting to get a timezone by passing a number/duration to `[]` or calling `all` directly will try to sort sort the values of `zones_map`. Those values are initialized by the return value of `create(zonename)` which returns `nil` if `TZInfo` is unable to find the timezone information. In our case the exception was triggered by an outdated tzdata package which did not include information for the "recently" added time zones. Before 078421bacba178eac6a8e607b16f3f4511c5d72f `zones_map` only returned the information that have been loaded into `@lazy_zone_map` which ignored time zones for which the data could not be loaded, this change restores the previous behaviour.
* | | Fix `ActiveSupport::Cache` compressionGodfrey Chan2018-04-111-0/+7
| | | | | | | | | | | | (See previous commit for a description of the issue)
* | | Merge pull request #32185 from nholden/human_readable_date_time_comparisonsRafael França2018-03-261-0/+5
|\ \ \ | | | | | | | | Add `before?` and `after?` methods to date and time classes
| * | | Add `before?` and `after?` methods to date and time classesNick Holden2018-03-061-0/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | Equality comparisons between dates and times can take some extra time to comprehend. I tend to think of a date or time as "before" or "after" another date or time, but I naturally read `<` and `>` as "less than" and "greater than." This change seeks to make date/time comparisons more human readable.
* | | Remove changelog header for unreleased versionRafael Mendonça França2018-03-131-2/+0
| | | | | | | | | | | | | | | | | | We only add the header when releasing to avoid some conflicts. [ci skip]
* | | Fix CHANGELOGs [ci skip]bogdanvlviv2018-03-121-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Add missing dots. - Remove reference to itself on GitHub. Usually, we add references to fixed issues only in a changelog. Follow up #32223
* | | URI.unescape handles mixed Unicode/escaped inputAshe Connor2018-03-071-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, URI.enscape could handle Unicode input (without any actual escaped characters), or input with escaped characters (but no actual Unicode characters) - not both. URI.unescape("\xe3\x83\x90") # => "バ" URI.unescape("%E3%83%90") # => "バ" URI.unescape("\xe3\x83\x90%E3%83%90") # => # Encoding::CompatibilityError We need to let `gsub` handle this for us, and then force back to the original encoding of the input. The result String will be mangled if the percent-encoded characters don't conform to the encoding of the String itself, but that goes without saying. Signed-off-by: Ashe Connor <ashe@kivikakk.ee>
* | Add separate test to ensure that `delegate` with `:private` option returns ↵bogdanvlviv2018-02-281-5/+2
| | | | | | | | | | | | | | | | correct value Remove extra comments `# Asking for private method` in activesupport/test/core_ext/module_test.rb Improve docs of using `delegate` with `:private` Update changelog of #31944