Skip to content

Selector#merge! with block #97

@nanocity

Description

@nanocity

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions