I've tested this by running rails c
both before and after git stash
. On Rails 4.1 in Mavericks, after following the instructions to add the versions
table and adding has_paper_trail
to three models, whenever I run rails c
I get
irb: warn: can't alias context from irb_context.
I've spent some time Googling without much luck, there's old threads talking about rspec
, but I don't see how that's relevant since I'm not using it. Any ideas why this is happening?
RSpec used to polute provide Object
top-level methods, e.g. describe
, context
, etc. Fortunately they've got rid of all the monkey patching in version 3, and now all these methods are namespaced under RSpec
.
One can change this behaviour through the expose_dsl_globally
config flag. For backwards compatibility, it defaults to true.
The warning shows up when you open the console because paper_trail
automatically loads its rspec helpers when rspec is found. And it calls RSpec.configure
before you have the chance to tweak your own configuration.
One possible solution would be paper_trail
to disable the automatically loading and let users to load it themselves when they see fit. However, I am not aware of the internals of the library, so I can't guarantee this wouldn't break other things.
Best!
This is now fixed in papertrail 4.0.0
, here's the commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With