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 default configuration #236

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Jay-Schneider
Copy link

closes #234

I think the implementation is rather straight forward, I am a bit concerned about testing this feature though. I came up with something that verifies the functionality of the feature but I needed to wiggle some things to make it work.

Since I usually use RSpec I am uncertain how to mock away the rails config with minitest. Also the necessity to do so maybe is a pointer that configuration of acts_as_paranoid should be handled differently? Please let me know what you think about it @mvz 🙂

}

temporary_paranoiac = Class.new(ActiveRecord::Base) do
acts_as_paranoid
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is kind of important, that the class definition (rather this method call) is done after setting up the config, while I didn't want to change the behaviour of all other paranoiacs used in the tests. This is why I create this class inside of the test.

@mvz mvz self-requested a review May 25, 2021 06:57
@mvz
Copy link
Contributor

mvz commented Jun 5, 2021

Thanks @Jay-Schneider, I think it's a really good idea to have a default configuration. Regarding where the configuration should live, I think it makes sense if it lives in ActsAsParanoid itself, so users can set ActsAsParanoid.config.default_options = { double_tap_destroys_fully: false }.

@mvz mvz removed their request for review June 5, 2021 12:00
@beekimrj
Copy link

What's the status of this PR? and @mvz is it configurable like that?

@zhisme
Copy link

zhisme commented Sep 15, 2023

👍

… add-default-configuration

# Conflicts:
#	test/test_helper.rb
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.

FeatureRequest: Global default options configuration
4 participants