origin icon indicating copy to clipboard operation
origin copied to clipboard

Selector#merge! with block

Open nanocity opened this issue 11 years ago • 0 comments

Current implementation of Selector#merge! does not support selecting value preference for duplicate keys.

Hash#merge! accomplish this by passing a block which is only called when keys are duplicated and return the desired value.

The thing is, I'm not using Selector#merge! directly but through ActiveSupport#reverse_merge! which is usefull to me to create custom filters but I'm not sure about manipulating selector hash is a good practice.

So, what do you think? It should be fine to support this or should I change my own implementation?

Thanks!

nanocity avatar Apr 16 '14 11:04 nanocity