aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml.Jeremy Kemper2013-01-081-6/+22
|
* Revert "Merge branch 'master-sec'"Jeremy Kemper2013-01-081-22/+6
| | | | | This reverts commit 88cc1688d0cb828c17706b41a8bd27870f2a2beb, reversing changes made to f049016cd348627bf8db0d72382d7580bf802a79.
* CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml.Jeremy Kemper2013-01-081-6/+22
|
* Namespace HashWithIndifferentAccessAkira Matsuda2013-01-071-1/+1
|
* Refactor Hash.from_xml.Steve Klabnik + Katrina Owen2012-12-211-1/+1
| | | | | | | | | | | | 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.
* Test Hash#diff deprecation, also prevent deprecation message in AS testsNikita Afanasenko2012-11-111-1/+3
|
* Implement replace method so key? works correctly.David Graham2012-10-261-0/+12
|
* Revert "remove unnecessary object/conversions file"Xavier Noria2012-10-161-0/+1
| | | | | | | This file is used at least by Active Merchant, its existence is maybe not necessary but no big deal either. This reverts commit ae9b3d7cecd77b9ace38671b183e1a360bf632b6.
* Merge pull request #7007 from Mik-die/hash_extractRafael Mendonça França2012-10-121-1/+25
|\ | | | | make Hash#extract! more symmetric with Hash#slice
| * add more testcases and doc about Hash#extract!Mikhail Dieterle2012-10-081-2/+9
| |
| * make Hash#extract! more symmetric with Hash#sliceMikhail Dieterle2012-10-081-0/+17
| |
* | let (array|hash)/conversions.rb load the extensions in ↵Xavier Noria2012-10-091-2/+0
| | | | | | | | object/to_(param|query).rb
* | adds a missing requireXavier Noria2012-10-091-0/+1
| |
* | adds missing requireXavier Noria2012-10-091-0/+1
| |
* | remove unnecessary object/conversions fileNihad Abbasov2012-10-021-1/+0
|/
* Allow passing block to deep_merge and deep_merge!Pranas Kiziela2012-09-131-0/+10
| | | | | Hash#merge accepts block that you can use to customize how hash values are merged. This change makes merge and deep_merge compatible.
* Fix AS tests due to builder change with nil values / empty stringsCarlos Antonio da Silva2012-09-071-2/+2
| | | | | Check 0180e090ab6cbe66f7b521a0c03e278a0463accd for more reasoning about that.
* Extend HashWithIndifferentAccess#update to take an optional blockLeo Cassarani2012-09-051-0/+23
| | | | | | | | | | | | | 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.
* Fix lookup on HashWithIndifferentAccess for array values.Chris Zetter2012-06-181-0/+7
|
* Add missing requires for deep_dup and hash ext testCarlos Antonio da Silva2012-05-241-0/+1
|
* Use deep_dup in the deep_transform_keys tests.Rafael Mendonça França2012-05-241-20/+98
| | | | | | | | 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
* Add Hash#deep_transform_keys and Hash#deep_transform_keys! Also convert ↵Mark McSpadden2012-05-231-1/+16
| | | | deep_*_keys to use deep_transform_keys.
* Adding deep versions of stringify_keys and symbolize_keys (plain and bang) ↵Lucas Húngaro2012-05-231-0/+92
| | | | for nested hashes
* Add Hash#transform_keys and Hash#transform_keys! and refactor *_keys methods ↵Mark McSpadden2012-05-231-0/+15
| | | | to use them.
* changed xml type datetime to dateTime, fixes #6328Angelo capilleri2012-05-231-2/+2
| | | | | | | | | 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
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-121-2/+2
|\ | | | | | | | | Conflicts: activesupport/lib/active_support/callbacks.rb
| * Fix copypaste. [ci skip]Edward Tsech2012-05-111-2/+2
| |
* | Test Hash#except can receive more than one argument.Edward Tsech2012-05-111-0/+6
|/
* Nice logic for deep_dup in railsAlexey Gaziev2012-05-061-15/+0
|
* fix HashWithIndifferentAccess.[] methodSergey Nartimov2012-03-231-0/+9
|
* Remove warning of unused variableRafael Mendonça França2012-03-081-1/+1
|
* refactor Hash#slice and Hash#extract!Vasiliy Ermolovich2012-03-061-0/+7
|
* remove usages of AS::OrderedHashVishnu Atrai2012-03-031-1/+1
|
* use AS::TestCase as the base classAaron Patterson2012-01-051-3/+3
|
* Initial pass at removing dead 1.8.x code from Active Support.José Valim2011-12-201-5/+1
| | | | | | There are a bunch of other implicit branches that adds 1.8.x specific code that still needs to be removed. Pull requests for those cases are welcome.
* Overrode Hash#nested_under_indifferent_access in HashWithIndifferentAccessMiles Georgi2011-12-111-0/+3
| | | | to return self.
* Fix test to reflect use of to_param for keysbrainopia2011-09-181-8/+8
|
* Issue #636 - Parsing an xml file with multiple records and extra attributes ↵Sidu Ponnappa2011-07-111-0/+49
| | | | (besides type) fails
* Test that HWIA.with_indifferent_access does not return selfDavid Lee2011-05-171-0/+1
|
* Use dup to preserve previous behaviorDavid Lee2011-05-171-1/+1
|
* Optimize parts of HashWithIndifferentAccessDavid Lee2011-05-171-0/+5
|
* indifferent access should recurse Hash subclassesDavid Lee2011-05-081-3/+12
| | | | | | | | | | | | | | This commit makes Hash subclasses convert to HWIA by default for nested objects of subclasses of Hash, but allows certain subclasses to prevent nested conversion by introducing Hash#nested_under_indifferent_access that subclasses can overwrite. ActiveSupport::OrderedHash is one such subclass that overwrites +nested_under_indifferent_access+, since implicitly converting it to HWIA would remove the ordering of keys and values in Ruby 1.8. This change is necessary because commit ce9456e broke nested indifferent access conversion for all subclasses of Hash.
* Fix bug with empty CDATA not being handled in Hash.from_xmlBradley Harris2011-04-291-2/+2
|
* Added test for empty CDATA bug in from_xmlBradley Harris2011-04-291-2/+8
|
* attributes no longer disappear if a tag contains whitespaceAndre Arko2011-04-141-0/+9
| | | | | | | | | | old: Hash.from_xml("<tag foo='bar'>\n</tag>") => {"tag"=>"\n"} new: Hash.from_xml("<tag foo='bar'>\n</tag>") => {"tag"=>{"foo"=>"bar", "__content__"=>"\n"}
* Fixed various isolated test missing requires within AS.Josh Kalderimis2011-01-121-0/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Only convert direct hash instances in hash with indifferent access.José Valim2010-11-261-0/+8
|
* HashWithIndifferentAccess should not change the subclass of an arrayLarry Sprock2010-11-141-0/+17
|
* Merge remote branch 'drogus/plugin_new'José Valim2010-11-111-0/+15
|\ | | | | | | | | Conflicts: railties/test/generators/app_generator_test.rb
| * Added Hash#deep_dup function which performs deep duplication on given hashPiotr Sarnacki2010-11-021-0/+15
| |