Skip to content

removing a normalization after it's already been added. #83

Open
@KevinVerre

Description

@KevinVerre

Great gem, but I have some questions that aren't super obvious from the ReadMe:

If I call normalize_attribute a second time on the same attribute, does it remove the first normalization or add to it?

normalize_attribute(:title, with: [:blank])
normalize_attribute(:title, with: [:strip]) # does this remove :blank ?
# or is it the same as doing this: normalize_attribute(:title, with: [:blank, :strip]) 

In my brief testing, it DID remove the previous one.

Second question, is there a remove a normalization after it has already been added?

For example, if a parent class has a normalization you don't want in the child class.
normalize_attribute(:title, with: [:blank, :strip]) # how to remove :strip ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions