Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KevinVerre opened this issue Sep 20, 2018 · 0 comments
Open

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

KevinVerre opened this issue Sep 20, 2018 · 0 comments
Labels

Comments

@KevinVerre
Copy link

KevinVerre commented Sep 20, 2018

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants