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

Add config to StubSessionProxy in order to fix error when scope is used. #411

Merged
merged 2 commits into from
Aug 17, 2018

Conversation

lulalala
Copy link
Contributor

Fix #247, where Sunspot is trying to access StubSessionProxy's config, but it does not exist. Add accessor to a default config to fix this.

@lulalala
Copy link
Contributor Author

bump

@njakobsen
Copy link
Contributor

Can you provide a failing test and a clear explanation of when this would be used? I haven't come across this issue through normal use, so I'm a little unfamiliar.

@lulalala
Copy link
Contributor Author

@njakobsen Sure. Here is the failing spec to emulate my action (rebased as two commits).

As I said, the main cause is the calling of config which is absent in the StubSessionProxy. This happens in #247 in different ways too.

@sairam
Copy link
Contributor

sairam commented Mar 29, 2018

This is still happening when an after_save action is calling index on an object.

NoMethodError: undefined method `config' for #Sunspot::Rails::StubSessionProxy:0x007ff100072c10

@jaredmoody
Copy link
Contributor

Having this same issue, would love this to be merged.

@serggl
Copy link
Collaborator

serggl commented Jul 30, 2018

This PR has some conflicting changes. Happy to review it once all conflicts are resolved

@lulalala
Copy link
Contributor Author

@serggl Yay it passed the test.

@lulalala
Copy link
Contributor Author

Hi @serggl could you review? Thanks

@serggl serggl merged commit ee84b8d into sunspot:master Aug 17, 2018
b-ggs pushed a commit to inDinero/sunspot that referenced this pull request Sep 18, 2019
…ed. (sunspot#411)

* Add spec to show that StubSessionProxy is missing config

* Add config to StubSessionProxy in order to fix error when scope is used.
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

Successfully merging this pull request may close these issues.

Rails 3.2.6, ActiveRecord::Relation, StubSessionProxy and =~
5 participants