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

FeatureRequest: Global default options configuration #234

Open
Jay-Schneider opened this issue May 21, 2021 · 0 comments · May be fixed by #236
Open

FeatureRequest: Global default options configuration #234

Jay-Schneider opened this issue May 21, 2021 · 0 comments · May be fixed by #236

Comments

@Jay-Schneider
Copy link

Jay-Schneider commented May 21, 2021

It is fairly common to use the same options over and over in all paranoid models. Like, if you decide to use boolean values for the deleted column it is likely that you do that for all models not only for some.
Recently I added double_tap_destroys_fully: false to all of the acts_as_paranoid calls in different models because we decided that this is some behaviour we actually don't want to have.

It would be nice to have the possibility to configure the gem centrally, not on a per-model-basis.

I think it could be a good idea to hook into Rails.application.config since the gem is strictly bound to ActiveRecord and is very likely that Rails is used as a whole.

edit: To be clear, all those settings should still be overridable in the acts_as_paranoid call and just tweak the currently hard coded default options in lib/acts_as_paranoid.rb#L25-L31.

I am happy to submit a pull request with a proposal if this is desired.

@Jay-Schneider Jay-Schneider linked a pull request May 25, 2021 that will close this issue
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 a pull request may close this issue.

1 participant