-
Notifications
You must be signed in to change notification settings - Fork 903
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
update readme for disabling papertrail within initializer #1176
Conversation
bfa05bf
to
502342f
Compare
Also note that I did mention both |
Thanks for taking a stab at this. I've worked hard on the documentation for PT's various on/off switches, and I'm always open to suggestions on how to improve the docs.
To say that they are aliases is effectively correct, and a useful addition to the docs. They are not technically aliases, but the former does delegate to the later. We can fine-tune the wording and placement.
Hmmm. According to my testing, environment files ( |
Thanks for the response, @jaredbeck. It could just be poor wording on my part; it's actually that any custom initialization of You're correct on the order, but from my experience (and from the other report), what happens is:
Due to the Obviously that's a lot of detail to put in the README, but the effect is still the same as what I described; custom initialization gets overwritten by the environment config (even though the environment config is evaluated first). |
Thanks for the clarification.
I'm seeing the same order. Maybe we should we deprecate
I think we should keep |
I hadn't thought too much about it before now, but it seems like there are some good arguments for deprecating For counter arguments, I could imagine something related to Rails magic and specifics with config objects and threads under the hood, but that's just thinking hypothetically; I can't actually think of anything concrete. That said, it also looks from the source like PaperTrail already accounts for threads well enough on its own. For other pro arguments, removing the If you do want to go forward with this, I'd suggest first raising/logging a deprecation messaging in the engine if |
Closed by #1183. Everyone, please comment here if you'd like to see |
Thanks @jaredbeck. Happy we were able to improve this for the next person. |
Hi. I'm on 10.3.2, and I'm going to keep this option, mostly because using the recommend |
This issue has been unresolved yet. At first,
Even if you set
initializer "paper_trail.initialisation" do |app|
enable = app.config.paper_trail[:enabled] # => nil
if enable.nil?
unless PaperTrail.enabled? # =>false
::ActiveSupport::Deprecation.warn(DPR_RUDELY_ENABLING)
PaperTrail.enabled = true # !!!override here!!!
end
else
::ActiveSupport::Deprecation.warn(DPR_CONFIG_ENABLED)
PaperTrail.enabled = enable
end
end Therefore, it will never become A workaround is to set However, is this behavior correct? If this behavior is correct, the documentation should explain where should we set |
Fixes #1038
Updating the readme to clarify that
PaperTrail.config.enabled
cannot be set within an initializer since it's eventually overwritten by the environment-specific config (or by the internal default oftrue
).I tried to be clear without giving unnecessary details. Also tried to use style consistent with the rest of the readme, but please let me know if you have suggestions.
master
(if not - rebase it).code introduces user-observable changes.
and description in grammatically correct, complete sentences.