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

Add ability to ignore certain namespaces #173

Closed
mak-dunkelziffer opened this issue Jan 2, 2023 · 5 comments
Closed

Add ability to ignore certain namespaces #173

mak-dunkelziffer opened this issue Jan 2, 2023 · 5 comments

Comments

@mak-dunkelziffer
Copy link

There are cases, where it would be nice to have a more comfortable method of ignoring multiple models or attributes at once in the config.

I have one case where the namespace DataMigration contains models that are not used in production and are kept for historic reasons. So I currently have 44 lines of the following in my config:

DataMigration::Article
  enabled: false
...
DataMigration::User
  enabled: false

I have another case where errors are "inherited" from another gem and I have 13 lines of the following in my config:

User:
  thredded_private_posts:
    enabled: false
...
  thredded_post_moderated_records:
    enabled: false

Being able to ignore all attributes starting with thredded_ (per model or even globally) would be nice.

@djezzzl
Copy link
Owner

djezzzl commented Jan 3, 2023

Hi @mak-dunkelziffer,

Thank you for suggesting this! We can add support for some patterns there. What syntax do you prefer the most?

For example, DataMigration::%, DataMigration::*, or somehow else.

@mak-dunkelziffer
Copy link
Author

If it is possible to pass a Ruby regex in the Yaml file, that would probably be the easiest. Then you wouldn't have to implement any custom pattern parsing yourself.

@djezzzl
Copy link
Owner

djezzzl commented Jan 12, 2023

Sounds fair! I will look into that.

By the way, would you like to contribute? I would be happy to help you and release it as soon as possible.

@djezzzl
Copy link
Owner

djezzzl commented Jul 1, 2023

Hi @mak-dunkelziffer,

I'm sorry it took me so long to implement this feature. Nevertheless, it's finally done, and if you're still using the gem, you can clean up your .database_consistency.yml configuration.

#202

Released in 1.7.11.

P.S. Fixed changelog.md with release commit.

@djezzzl djezzzl closed this as completed Jul 1, 2023
@djezzzl
Copy link
Owner

djezzzl commented Jul 1, 2023

You can follow this wiki for precise syntax: https://github.com/djezzzl/database_consistency/wiki/regexp-support-in-configuration.

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

No branches or pull requests

2 participants