| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Before HashWithIndifferentAccess were doing deep_dup of the inner hashes
when Hash doesn't do. Now both are behaving in the same way.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Hash#deep_*_keys(!) recurse into nested arrays.
Conflicts:
activesupport/CHANGELOG.md
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Following methods now recursively transform nested arrays, too.
* Hash#deep_transform_keys
* Hash#deep_transform_keys!
* Hash#deep_stringify_keys
* Hash#deep_stringify_keys!
* Hash#deep_symbolize_keys
* Hash#deep_symbolize_keys!
|
|\ \
| | |
| | |
| | | |
Fix Hash#deep_merge bug and improve documentation — resolves #12738
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously merging into a hash with a falsy value would not result in
the merge-block being called. The fix is simply to check for presence
of the key in the hash.
The documentation example for `deep_merge` now appropriately
demonstrates what a deep merge does.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
In particular, `.new`, `#update`, `#merge`, `#replace` all accept
objects which respond to `#to_hash`, even if those objects are not
Hashes directly.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Adding Hash#compact and Hash#compact! methods
* Using Ruby 1.9 syntax on documentation
* Updating guides for `Hash#compact` and `Hash#compact!` methods
* Updating CHANGELOG for ActiveSupport
* Removing unecessary protected method and lambda for `Hash#compact` implementations
* Performing `Hash#compact` implementation - https://gist.github.com/tinogomes/8332883
* fixing order position
* Fixing typo
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
keys. Also, show the wrong value as it was entered.
{ :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
=> ArgumentError: Unknown key: failore
{ 'failore' => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
=> ArgumentError: Unknown key: failore
{ 'failore' => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
=> ArgumentError: Unknown key: "failore". Valid keys are: :failure, :funny
{ :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
=> ArgumentError: Unknown key: :failore. Valid keys are: :failure, :funny
Conflicts:
activerecord/CHANGELOG.md
Closes #11624.
|
| | |
|
| |
| |
| |
| |
| | |
Hash#select! returns nil if the hash didn't change and thus behaves differently
from select, so it's return value can't be used as result for the latter.
|
| |
| |
| |
| |
| | |
If you're using it to compare hashes for the purpose of testing,
please use MiniTest's assert_equal instead.
|
|\ \
| |/
|/| |
HashWithIndifferentAccess#select working as intended
|
| |
| |
| |
| |
| |
| | |
Before this commit, #reject returned a HashWithIndifferentAccess,
whereas #select returned a Hash. Now #select also returns a
HashWithIndifferentAccess.
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This reverts commit 88cc1688d0cb828c17706b41a8bd27870f2a2beb, reversing
changes made to f049016cd348627bf8db0d72382d7580bf802a79.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Three basic refactors in this PR:
* We extracted the logic into a method object. We now don't define a tone of extraneous methods on Hash, even if they were private.
* Extracted blocks of the case statement into methods that do the work. This makes the logic more clear.
* Extracted complicated if clauses into their own query methods. They often have two or three terms, this makes it much easier to see what they _do_.
We took care not to refactor too much as to not break anything, and put comments where we suspect tests are missing.
We think ActiveSupport::XMLMini might be a good candidate to move to a plugin in the future.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This file is used at least by Active Merchant, its existence
is maybe not necessary but no big deal either.
This reverts commit ae9b3d7cecd77b9ace38671b183e1a360bf632b6.
|
|\
| |
| | |
make Hash#extract! more symmetric with Hash#slice
|
| | |
|
| | |
|
| |
| |
| |
| | |
object/to_(param|query).rb
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
| |
Hash#merge accepts block that you can use to customize how hash values
are merged. This change makes merge and deep_merge compatible.
|
|
|
|
|
| |
Check 0180e090ab6cbe66f7b521a0c03e278a0463accd for more reasoning about
that.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a block is passed into the method, it will be invoked for each
duplicated key, with the key in question and the two values as
arguments. The value for the duplicated key in the receiver will
be set to the return value of the block.
This behaviour matches Ruby's long-standing implementation of
Hash#update and is intended to provide a more consistent interface.
HashWithIndifferentAccess#merge is also affected by the change, as it
uses #update internally.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Using only dup make some tests to not catch up an implementation error
because the methods were changing the nested hashes.
Related to:
https://github.com/rails/rails/commit/541429fbe49b0671adb3842ab1818230d670ef9f#L1R96
|
|
|
|
| |
deep_*_keys to use deep_transform_keys.
|
|
|
|
| |
for nested hashes
|
|
|
|
| |
to use them.
|
|
|
|
|
|
|
|
|
| |
XmlMini define the xml 'datatime', but according to
http://www.w3.org/TR/xmlschema-2/#dateTime could be better
change this to 'dateTime' with upper case letter 'T.
So 'DateTime' and 'Time' are redefined from 'datetime' to 'dateTime'
add the changing to the changelog
|
|\
| |
| |
| |
| | |
Conflicts:
activesupport/lib/active_support/callbacks.rb
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|