rsolr-ext
rsolr-ext copied to clipboard
question on deprecation re Rsolr::Ext.connect
When starting up a Blacklight app that uses RSolr::Ext, I get this:
"DEPRECATION WARNING: Future versions of RSolr::Ext will require initialization via RSolr::Ext.connect."
Can you explain what the deprecated behavior is exactly, and what the non-deprecated alternative is? How should I fix Blacklight code to not trigger this deprecation warning (and more importantly, be future-forward and not be using deprecated behavior).
Thanks.
Hey Jonathan. When you require rsolr-ext, it automatically overrides code in rsolr. I think being explicit about using rsolr-ext functionality is best. The change makes it so that rsolr-ext does not override rsolr when loading the library. Using RSolr::Ext.connect fixes this.
You don't have to do anything in Blacklight, it's already there:
https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight.rb#L62
Hmm, something does not compute.
If it's already there, why am I getting the deprecation warning on boot? Are you saying that I may not be using deprecated behavior, but I'm getting a deprecation warning anyway?
If I'm getting a deprecation warning, my assumption is I'm (or BL code) is doing something deprecated. If BL code is doing somethign deprecated, I want to figure out what and fix it so it no longer is. But I'm stuck here, I don't know where to start to figure out what it's doing that's deprecated and how to fix it. Any additional hints?
On Mon, Jun 6, 2011 at 5:27 PM, mwmitchell [email protected] wrote:
Hey Jonathan. When you require rsolr-ext, it automatically overrides code in rsolr. I think being explicit about using rsolr-ext functionality is best. The change makes it so that rsolr-ext does not override rsolr when loading the library. Using RSolr::Ext.connect fixes this.
You don't have to do anything in Blacklight, it's already there:
https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight.rb#L62
Reply to this email directly or view it on GitHub: https://github.com/mwmitchell/rsolr-ext/issues/15#comment_1312021
Hmm, I was wrong about this. I'm removing the warning. The only thing RSolr::Ext#connect is doing is wrapping RSolr#connect. The thing I don't like is the auto-mixin when rsolr-ext is loaded. But if you're loading it, you want to use it.
Awesome, thanks. I don't entirely get the thing you don't like, but if
you document somewhere (the wiki?) "Don't do it like this, instead do
it like that", then I'll make sure any code I work on does it how you
suggest, if feasible.
(In upgrading my app from rails2/blacklight2 to blacklight/rails3, I
need to pay a lot of attention to deprecation warnings to get things
set up for, say, Rails 3.1. So if I see a deprecation warning, say
when running my test suite, Ii change my code to do it non-deprecated.
So it's important I don't get deprecation warnings unless i'm doing
something deprecated, so I can know when I've succesfully fixed all
deprecated uses )
On Jun 6, 2011, at 11:06 PM, mwmitchell wrote:
Hmm, I was wrong about this. I'm removing the warning. The only
thing RSolr::Ext#connect is doing is wrapping RSolr#connect. The
thing I don't like is the auto-mixin when rsolr-ext is loaded. But
if you're loading it, you want to use it.Reply to this email directly or view it on GitHub: https://github.com/mwmitchell/rsolr-ext/issues/15#comment_1313338