aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/hash_with_indifferent_access.rb
Commit message (Collapse)AuthorAgeFilesLines
* Change syntax format for example returned valuesPrem Sichanugrist2013-11-111-1/+1
| | | | | | | | | According to our guideline, we leave 1 space between `#` and `=>`, so we want `# =>` instead of `#=>`. Thanks to @fxn for the suggestion. [ci skip]
* Make HashWithIndifferentAccess#select always return the hash.Marc Schütz2013-07-061-1/+1
| | | | | 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.
* Merge pull request #10627 from vipulnsward/destructive_symbolizeCarlos Antonio da Silva2013-06-251-1/+1
|\ | | | | Change to destructive `deep_symbolize_keys` to avoid a new hash creation.
| * change to destructive `deep_symbolize_keys` after ↵Vipul A M2013-05-151-1/+1
| | | | | | | | https://github.com/rails/rails/commit/df24b8790f22384a068fece7042f04ffd2fcb33e which allows to do so. This helps to avoid extra hash object creation, by symbolizing inplace
* | Merge pull request #10740 from mrsimo/hash-with-indifferent-access-selectRafael Mendonça França2013-06-141-0/+4
|\ \ | | | | | | HashWithIndifferentAccess#select working as intended
| * | HashWithIndifferentAccess#select working as intendedAlbert Llop2013-05-231-0/+4
| | | | | | | | | | | | | | | | | | Before this commit, #reject returned a HashWithIndifferentAccess, whereas #select returned a Hash. Now #select also returns a HashWithIndifferentAccess.
* | | Prevent side effects in `Hash#with_indifferent_access`.Yves Senn2013-05-291-6/+12
|/ /
* / Fix HWIA#to_hash behavior with array of hashes.kennyj2013-05-161-2/+2
|/
* Merge pull request #10266 from vipulnsward/fix_HIA_to_hashRafael Mendonça França2013-05-141-3/+7
|\ | | | | fix HashWithIndifferentAccess#to_hash behaviour
| * fix HashWithIndifferentAccess#to_hash behaviourVipul A M2013-04-191-3/+7
| |
* | symbolize_keys => symbolize_keys! on new hash;Vipul A M2013-04-191-1/+1
|/ | | | "There're" => There are for better readability
* change merge to merge!Vipul A M2013-03-291-1/+1
|
* Implement replace method so key? works correctly.David Graham2012-10-261-0/+8
|
* update AS docs [ci skip]Francesco Rodriguez2012-09-171-4/+5
|
* update some AS code examples to 1.9 hash syntax [ci skip]Francesco Rodriguez2012-09-121-19/+14
|
* Extend HashWithIndifferentAccess#update to take an optional blockLeo Cassarani2012-09-051-6/+21
| | | | | | | | | | | | | 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.
* +"foo"+ doesn't generate code tag [ci skip]Rafael Mendonça França2012-07-211-1/+1
|
* Lets be consistent with whitespaces at documentationRafael Mendonça França2012-07-211-13/+13
|
* makes a pass over the API of ActiveSupport::HashWithIndifferentAccessXavier Noria2012-07-211-22/+70
|
* Hash#fetch(fetch) is not the same as doing hash[key]Xavier Noria2012-07-211-1/+11
|
* Use map! instead of replace + mapCarlos Antonio da Silva2012-06-181-1/+1
|
* Fix lookup on HashWithIndifferentAccess for array values.Chris Zetter2012-06-181-1/+2
|
* Adding deep versions of stringify_keys and symbolize_keys (plain and bang) ↵Lucas Húngaro2012-05-231-0/+4
| | | | for nested hashes
* fix HashWithIndifferentAccess.[] methodSergey Nartimov2012-03-231-0/+4
|
* search private and protected methods for convert_keyAaron Patterson2012-03-201-1/+1
|
* Clean up module docs [ci skip]Vijay Dev2012-03-071-4/+3
| | | | Removed some useless docstrings and no-doc'ed some.
* Overrode Hash#nested_under_indifferent_access in HashWithIndifferentAccessMiles Georgi2011-12-111-0/+4
| | | | to return self.
* docs formatting changesVijay Dev2011-09-011-1/+1
|
* document HashWithIndifferentAccess#extractable_options?Shawn Drost2011-07-071-0/+2
|
* Use dup to preserve previous behaviorDavid Lee2011-05-171-1/+1
|
* Optimize parts of HashWithIndifferentAccessDavid Lee2011-05-171-2/+10
|
* indifferent access should recurse Hash subclassesDavid Lee2011-05-081-2/+2
| | | | | | | | | | | | | | 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.
* Some style changessuchasurge2011-03-061-2/+2
|
* Only convert direct hash instances in hash with indifferent access.José Valim2010-11-261-4/+3
|
* HashWithIndifferentAccess should not change the subclass of an arrayLarry Sprock2010-11-141-1/+1
|
* Ensure that HashWithIndifferentAccess duplication preserves class (for ↵laserlemon2010-11-071-2/+4
| | | | | | sublclasses) and default value [#5724 state:resolved] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Override #store to be consistent with #[].Andrea Campi2010-10-101-0/+2
| | | | | | [#5775 state:resolved] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* now for real, the suite loads everything and these went unpatchedXavier Noria2010-08-191-3/+3
|
* avoids a ton o warnings ↵Xavier Noria2010-08-191-1/+6
| | | | activesupport/lib/active_support/dependencies.rb:239: warning: loading in progress, circular require considered harmful ... activesupport/lib/active_support/core_ext/hash/indifferent_access.rb while running the suite in Ruby 1.9.2
* Add missing require in ActiveSupport::HashWithIndifferentAccess [#5189 ↵Chris Hoffman2010-08-021-0/+1
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* HWIA relies on Hash#symbolize_keys and #stringify_keys extensions.Santiago Pastorino2010-04-221-0/+2
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Change HWIA#stringify_keys to return a HWIA not a HashJeremy Kemper2010-04-221-1/+1
|
* Restore HWIA#stringify_keys! and update changelogJeremy Kemper2010-04-221-2/+2
|
* HWIA delegates to to_hash symbolize_keys and stringify_keys and bang methods ↵Santiago Pastorino2010-04-221-2/+4
| | | | | | are not in the api Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Limit Array#extract_options! to directl instances of Hash and HWIA. Add ↵wycats2010-03-271-0/+4
| | | | extractable_options? to Hash so that subclasses of Hash can opt-into extractable behavior. This fixes an issue where respond_with wasn't working with subclasses of Hash that were provided by other libraries (such as CouchDB or Mashie) [#4145 state:resolved]
* ActiveSupport Hash optimizations [#2902 state:resolved]Lourens Naude2009-07-151-1/+5
| | | | Signed-off-by: Carl Lerche <carllerche@mac.com>
* Namespace HashWithIndifferentAccessJeremy Kemper2009-03-211-105/+109
|
* Convert hash extension modules to class reopensJeremy Kemper2009-03-211-0/+129