aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/ordered_hash_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Removes unused varsSantiago Pastorino2010-07-241-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* AS json refactor, move to_json implementation to core_ext and a cleanup a ↵Santiago Pastorino2010-07-011-0/+1
| | | | bit the code
* Oops. Make previous commit pass on 1.9.2.José Valim2010-06-261-1/+2
|
* Tidy up tests in previous commit since they did not assure an OrderedHash is ↵José Valim2010-06-261-3/+2
| | | | | | returned (the test would pass for an array and would pass by chance for hashes). [#4875 state:resolved]
* Add OrderedHash#invert to preserve order in ruby 1.8 [#4875]chaitanyav2010-06-261-0/+6
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Work around the fact the JSON gem was overwriting to_json implementation for ↵José Valim2010-06-261-0/+7
| | | | | | | all Ruby core classes. This is required because the JSON gem is incompatible with Rails behavior and was not allowing ActiveModel::Errors to be serialized. So we need to ensure Rails implementation is the one triggered. [#4890 state:resolved]
* Alias ActiveSupport::OrderedHash#update to ActiveSupport::OrderedHash.merge!Paul Mucur2010-06-251-0/+6
| | | | | | | | This ensures that an OrderedHash's keys are set up appropriately when using update. [#4973 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* revises implementation of AS::OrderedHash#merge!Xavier Noria2010-06-131-16/+17
|
* Revert "hash merging with a block ignores non-existing keys altogether"Xavier Noria2010-06-131-16/+17
| | | | | | This reverts commit 72f9fec607c4a72b2e88995d0cb32b16b96e9068. It is wrong, this feature is a little undocumented, doing some research.
* hash merging with a block ignores non-existing keys altogetherXavier Noria2010-06-131-17/+16
|
* re-organized test for merge into separate testsPaul Barry2010-06-131-13/+21
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* Support passing a block to ActiveSupport::OrderedHash's merge and merge! ↵Paul Mucur2010-06-131-0/+13
| | | | | | | | [#4838 state:committed] For better consistency with Ruby's own Hash implementation. Signed-off-by: Xavier Noria <fxn@hashref.com>
* Adding custom yaml (de-)serialization for OrderedHashGregor Schmidt2010-01-271-0/+24
| | | | | | [#3608 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix OrderedHash#replaceChris Hapgood2009-11-051-0/+7
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fixed ActiveSupport::OrderedHash::[] work identically to ::Hash::[] in ruby ↵Brian Abreu2009-07-021-1/+24
| | | | | | 1.8.7 [#2832 state:resolved] Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
* ActiveSupport::OrderedHash[1,2,3,4] creates an OrderedHash instead of a Hash.Douglas F Shearer2009-05-111-0/+6
| | | | | | [#2615 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* ActiveSupport::OrderedHash#to_a method returns an ordered set of arrays. ↵Ken Collins2009-05-101-0/+4
| | | | | | | Matches ruby1.9's Hash#to_a. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2629 state:committed]
* Fix OrderedHash#inspect recursionJeremy Kemper2009-03-041-1/+7
|
* Fix OrderedHash#to_hash to return self instead of a new hash with self as ↵Jeremy Kemper2009-03-031-1/+5
| | | | default value
* Dup keys in OrderedHash to prevent them from being modified [#1676 ↵Brandon Keepers2009-01-161-1/+9
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Make delete_if/reject faster and fix other mutatorsFrederick Cheung2008-12-151-0/+37
| | | | | | [#1559 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed ActiveSupport::OrderedHash #delete_if, #reject!, and #reject, which ↵Eloy Duran2008-12-111-1/+21
| | | | | | | | did not sync the @keys after the operation. This probably holds true for other mutating methods as well. Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Rework ActiveSupport::OrderedHash to make lookups fasterFrederick Cheung2008-12-101-0/+10
| | | | | | [#1352 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Added ActiveSupport::OrderedHash#each_key and ↵Christoffer Sawicki2008-11-261-0/+12
| | | | | | ActiveSupport::OrderedHash#each_value [#1410 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add more standard Hash methods to ActiveSupport::OrderedHash [#314 ↵Steve Purcell2008-06-031-0/+19
| | | | | | state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Create a seperate file for ActiveSupport::OrderedHash.Joshua Peek2008-05-141-0/+45