-
Notifications
You must be signed in to change notification settings - Fork 196
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
base: master
Are you sure you want to change the base?
Add default configuration #236
Conversation
to set default options for acts_as_paranoid globally
} | ||
|
||
temporary_paranoiac = Class.new(ActiveRecord::Base) do | ||
acts_as_paranoid |
There was a problem hiding this comment.
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.
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 |
What's the status of this PR? and @mvz is it configurable like that? |
👍 |
… add-default-configuration # Conflicts: # test/test_helper.rb
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 🙂