aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Able to initalize default value for thread_mattr_*Guilherme Mansur2019-08-051-0/+8
| | | | | | | | | | | | | | | | | Added the ability to initialize `thread_mattr_*` methods with default values like so: ``` ruby class MyClass thread_attr_reader :foo, default: :foo thread_attr_writer :bar, default: :bar thread_attr_accessor: baz do "baz" end end ``` This is consistent with the api exposed by `mattr_accessor`.
* Merge pull request #36412 from robotdana/compact_blankRafael Mendonça França2019-07-251-0/+5
|\ | | | | | | Add compact_blank shortcut for reject(&:blank?)
| * Add compact_blank shortcut for reject(&:blank?)Dana Sherson2019-06-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | I frequently find myself having to .compact but for blank. which means on an array reject(&:blank?) (this is fine), or, on a hash `.reject { |_k, v| v.blank? }` which is slightly more frustrating and i usually write it as .reject(&:blank?) first and am confused when it's trying to check if the keys are blank. I've added the analagous .compact_blank! where there's a reject! to build on (there's also a reject! in Set, but there's no other core_ext touching Set so i've left that alone)
* | Make ActiveSupport::Logger Fiber-safeSenya2019-07-241-0/+32
| | | | | | | | | | Use Fiber.current.__id__ in ActiveSupport::Logger#local_level= in order to make log level local to Ruby Fibers in addition to Threads.
* | Improve changelog entry, remove extraneous word [ci skip]Carlos Antonio da Silva2019-07-231-2/+2
| |
* | Remove changelog entry for backported changeGeorge Claghorn2019-07-221-7/+0
| |
* | Omit marshal_dump & _dump from delegate_missing_toAaron Lipman2019-07-171-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exclude missing marshal_dump and _dump methods from being delegated to an object's delegation target via the delegate_missing_to extension. This avoids unintentionally adding instance variables to an object during marshallization, should the delegation target be a method which would otherwise add them. In current versions of Ruby, a bug exists in the way objects are marshalled, allowing for instance variables to be added or removed during marshallization (see https://bugs.ruby-lang.org/issues/15968). This results in a corrupted serialized byte stream, causing an object's instance variables to "leak" into subsequent serialized objects during demarshallization. In Rails, this behavior may be triggered when marshalling an object that uses the delegate_missing_to extension, if the delegation target is a method which adds or removes instance variables to an object being marshalled - when calling Marshal.dump(object), Ruby's built in behavior will check whether the object responds to :marshal_dump or :_dump, which in turn triggers the delegation target method in the responds_to_missing? function defined in activesupport/lib/active_support/core_ext/module/delegation.rb While future versions of Ruby will resolve this bug by raising a RuntimeError, the underlying cause of this error may not be readily apparent when encountered by Rails developers. By excluding marshal_dump and _dump from being delegated to an object's target, this commit eliminates a potential cause of unexpected behavior and/or RuntimeErrors. Fixes #36522
* | Improve changelog entry, remove extraneous word [ci skip]Carlos Antonio da Silva2019-07-111-2/+2
| |
* | Do not use hard tabs in CHANGELOGs [ci skip]Ryuta Kamizono2019-07-111-6/+6
| | | | | | | | | | | | It doesn't work as indentation preperly. https://github.com/rails/rails/blob/ba7634d304008a4e6170fd701a2b7e75e1d83aea/activesupport/CHANGELOG.md
* | Allow `on_rotation` in MessageEncryptor to be passed in constructor:Edouard CHIN2019-06-061-0/+17
|/ | | | | | | | | | | | | | | | | | | | | - Use case: I'm writing a wrapper around MessageEncryptor to make things easier to rotate a secret in our app. It works something like ```ruby crypt = RotatableSecret.new(['old_secret', 'new_secret']) crypt.decrypt_and_verify(message) ``` I'd like the caller to not have to care about passing the `on_rotation` option and have the wrapper deal with it when instantiating the MessageEncryptor object. Also, almost all of the time the on_rotation should be the same when rotating a secret (logging something or StatsD event) so I think it's not worth having to repeat ourselves each time we decrypt a message.
* Address 639d7be. Readd changelog line; remove needless explicit return.Kasper Timm Hansen2019-05-241-0/+1
|
* Add :allow_nil option to delegate_missing_to; use in ActiveStorageMatt Tanous2019-05-231-1/+6
| | | | attachment
* Fix broken markup in CHANGELOG [ci skip]Ryuta Kamizono2019-05-081-8/+9
| | | | https://github.com/rails/rails/blob/65bdd6ad085a02b976cd36f135c2a5ffb522e5a0/activesupport/CHANGELOG.md
* Frozen truncate (#36109)Jordan Thomas2019-04-261-0/+19
| | | | | | | | | | | | | | * Add test asserting truncate returns unfrozen string * Ensure strings returned from truncate are not frozen This fixes an issue where strings too short to be truncated were returned unfrozen, where as long-enough strings were returned frozen. Now retuned strings will not be frozen whether or not the string returned was shortened. * Update changelog w/ new truncate behavior description [Jordan Thomas + Rafael Mendonça França]
* Start Rails 6.1 developmentRafael Mendonça França2019-04-241-493/+1
|
* Introduce Actionable ErrorsGenadi Samokovarov2019-04-191-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actionable errors let's you dispatch actions from Rails' error pages. This can help you save time if you have a clear action for the resolution of common development errors. The de-facto example are pending migrations. Every time pending migrations are found, a middleware raises an error. With actionable errors, you can run the migrations right from the error page. Other examples include Rails plugins that need to run a rake task to setup themselves. They can now raise actionable errors to run the setup straight from the error pages. Here is how to define an actionable error: ```ruby class PendingMigrationError < MigrationError #:nodoc: include ActiveSupport::ActionableError action "Run pending migrations" do ActiveRecord::Tasks::DatabaseTasks.migrate end end ``` To make an error actionable, include the `ActiveSupport::ActionableError` module and invoke the `action` class macro to define the action. An action needs a name and a procedure to execute. The name is shown as the name of a button on the error pages. Once clicked, it will invoke the given procedure.
* Preserve html_safe? status on ActiveSupport::SafeBuffer#*r7kamura2019-04-191-0/+12
|
* running test with_info_handler methodMauri Mustonen2019-04-161-0/+5
|
* depend on Zeitwerk 2.1.0Xavier Noria2019-04-091-0/+8
|
* depend on Zeitwerk 2Xavier Noria2019-04-071-0/+6
|
* Follow up tweaks b89a3e7e638a50c648a17d09c48b49b707e1d90d [ci skip]Ryuta Kamizono2019-03-311-1/+1
| | | | | | * use backticks instead of `+` * and more (e.g. missed replacing `Array#excluding` and `Enumerable#excluding` in b89a3e7e638a50c648a17d09c48b49b707e1d90d)
* Tweaks CHANGELOGs and docs [ci skip]Ryuta Kamizono2019-03-311-15/+15
| | | | | | | * add leading `#` before `=>` since hash rocket is valid Ruby code * add backticks * remove trailing spaces * and more
* fixes eager loading edge case in :zeitwerk modeXavier Noria2019-03-301-0/+9
|
* Fix bug in Range comparisons when comparing to excluded-end RangeOwen Stephens2019-03-281-0/+14
| | | | | | | | | | | | | | | Before: ```ruby (1..10).cover?(1...11) => false ``` After: ```ruby (1..10).cover?(1...11) => true ``` See https://git.io/fjTtz for the commit against Ruby core that added support for Range arguments, with similar handling of this case.
* Use weak references in descendants trackerEdgars Beigarts2019-03-261-0/+5
| | | | It allows anonymous subclasses to be garbage collected.
* Fix AS CHANGELOG typoAli Ibrahim2019-03-221-1/+1
|
* Update CHANGELOG and docsAli Ibrahim2019-03-221-0/+7
| | | | with change to ActiveSupport::Notifications::Instrumenter#instrument
* Fix Time#advance to work with dates before 1001-03-07Andrew White2019-03-181-0/+14
| | | | | | | | | In #10634 the behavior of Time#advance was changed to maintain a proleptic gregorian calendar for dates before calendar reform. However it didn't full address dates a long time before calendar reform and they gradually drift away from the proleptic calendar the further you go back in time. Fix this by always converting the date to gregorian before calling advance which sets the reform date to -infinity.
* Engines are reloaded in Zeitwerk mode [closes #35618]Xavier Noria2019-03-151-0/+4
|
* Merge tag 'v6.0.0.beta3'eileencodes2019-03-131-0/+5
|\ | | | | | | v6.0.0.beta3 release
| * Prep releaseeileencodes2019-03-111-0/+5
| | | | | | | | | | | | | | * Update RAILS_VERSION * Bundle * rake update_versions * rake changelog:header
* | Fix typo s/ActiveSupport::Timezone/ActiveSupport::TimeZone/ [ci skip]Ryuta Kamizono2019-03-131-1/+1
| |
* | Merge pull request #35575 from sharang-d/changelog-for-parameterizeRyuta Kamizono2019-03-121-1/+13
|\ \ | | | | | | | | | Add changelog entry for transliterate/parameterize accepting `locale` [ci skip]
| * | Add changelog entry for transliterate/parameterize accepting `locale` [ci skip]Sharang Dashputre2019-03-121-0/+10
|/ /
* / Added Array#including, Array#excluding, Enumerable#including, ↵David Heinemeier Hansson2019-03-051-0/+18
|/ | | | Enumerable#excluding
* Preparing for 6.0.0.beta2 releaseRafael Mendonça França2019-02-251-0/+2
|
* Register new autoloading in AS CHANGELOG [ci skip]Xavier Noria2019-02-141-0/+4
| | | | | | | | There is too much to say about it for a CHANGELOG entry, and linking to the original PR could mislead if there are later changes as already happened with the gem dependency, so just a one-liner. For final we'll up to date documentation.
* Merge pull request #32861 from zvkemp/asn-unsubscribe-proxyAaron Patterson2019-02-111-0/+4
|\ | | | | use ProxyPattern to match for ActiveSupport::Notifications fanout/unsubscribe
| * use a proxy matcher for AS::N fanoutzvkemp2019-02-111-0/+4
| |
* | Add 'Hash#deep_transform_values', and 'Hash#deep_transform_values!'Guillermo Iguaran2019-02-081-0/+4
|/
* Merge pull request #35063 from rosa/current-before-reset-callbackRafael Mendonça França2019-02-041-2/+5
|\ | | | | | | Support before_reset callback in CurrentAttributes
| * Support before_reset callback in CurrentAttributesRosa Gutierrez2019-01-301-1/+4
| | | | | | | | | | | | | | | | | | This is useful when we need to do some work associated to `Current.reset` but that work depends on the values of the current attributes themselves. This cannot be done in the supported `resets` callback because when the block is executed, CurrentAttributes's instance has already been reset. For symmetry, `after_reset` is defined as alias of `resets`.
* | Remove the Kernel#` override that turns ENOENT into nilAkinori MUSHA2019-01-311-0/+4
|/ | | | | | | | | | | | ActiveSupport overrides `` Kernel#` `` so that it would not raise `Errno::ENOENT` but return `nil` instead (due to the last statement `STDERR.puts` returning nil) if a given command were not found. Because of this, you cannot safely say somthing like `` `command`.chomp `` when ActiveSupport is loaded. It turns out that this is an outdated monkey patch for Windows platforms to emulate Unix behavior on an ancient version of Ruby, and it should be removed by now.
* Merge pull request #35080 from sos4nt/add_hash_assocRyuta Kamizono2019-01-301-0/+7
|\ | | | | | | Add HashWithIndifferentAccess#assoc
| * Add HashWithIndifferentAccess#assocStefan Schüßler2019-01-301-0/+6
|/
* Preparing for 6.0.0.beta1 releaseRafael Mendonça França2019-01-181-0/+2
|
* Remove deprecated `Module#reachable?` methodRafael Mendonça França2019-01-171-0/+4
|
* Remove deprecated `#acronym_regex` method from `Inflections`Rafael Mendonça França2019-01-171-0/+4
|
* 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