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

question on deprecation re Rsolr::Ext.connect #15

Open
jrochkind opened this issue Jun 6, 2011 · 4 comments
Open

question on deprecation re Rsolr::Ext.connect #15

jrochkind opened this issue Jun 6, 2011 · 4 comments

Comments

@jrochkind
Copy link

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.

@mwmitchell
Copy link
Owner

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

@jrochkind
Copy link
Author

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:
#15 (comment)

@mwmitchell
Copy link
Owner

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.

@jrochkind
Copy link
Author

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:
#15 (comment)

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

No branches or pull requests

2 participants