Skip to content

Model method to normalize input values #3

@avit

Description

@avit

I'd like to have a class method such as normalize_values that does something like this:

input = {product_code: "  ABC123  "}
clean_input = Product.normalize_values(input)
#=> {product_code: "ABC123"}
Product.where(clean_input)

This would effectively build a new model instance to push values through the normalizer, and read them back. Is that within scope of your gem for a pull request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions