Skip to content

Conversation

@liepauls
Copy link

Hi and thanks for maintaining this gem!

Here's a potential implementation of normalize to strip records (#67).

There are two caveats:

  1. ActiveModel now has to be used instead of ActiveAttr to build test objects. Also plain ActiveAttr models lack .normalize method, thus aren't supported anymore.
  2. if and unless options are no longer supported. normalize doesn't have those options and the record isn't available in the normalize context. I guess this kinda makes sense, because without this option, we're normalizing the data consistently across all instances of a specific model. However it sucks that the gem's API is changed

If normalize approach is something we want to continue with, there are few things left for me to do:

  1. Add some tests (maybe test that #save(validate: false) works, etc.)
  2. Remove if and unless from VALID_OPTIONS, and delete tests for if and unless options
  3. Update readme

Feel free to question, criticize and comment 🙏

@liepauls
Copy link
Author

@rmm5t have you had the chance to look at the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant