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

Fix backwards compatibility loading engine models on Rails 3.0 #972

Merged
merged 2 commits into from
Oct 26, 2020

Conversation

rbngzlv
Copy link
Contributor

@rbngzlv rbngzlv commented Mar 26, 2020

Hi!

As mentioned in the issue #739, the rake task sunspot:reindex fails on Rails 3.0, because the instance method on the Engine is not implemented in this version.

The error is:

NoMethodError:
   undefined method `instance' for TestEngine::Engine:Class

The offending line is:

Rails::Engine.subclasses.each{|engine| engine.instance.eager_load!}

But is possible that this line isn't really needed? I added a spec to check that engine models are loaded, can somebody else take a look?

And thank you all for the work on the gem!

@rbngzlv rbngzlv force-pushed the fix_backwards_compatibility_rails_3.0 branch 2 times, most recently from 81bfe49 to 03da66e Compare August 30, 2020 19:18
@rbngzlv rbngzlv force-pushed the fix_backwards_compatibility_rails_3.0 branch from 03da66e to 107fa0a Compare September 17, 2020 11:36
@rbngzlv rbngzlv force-pushed the fix_backwards_compatibility_rails_3.0 branch from 107fa0a to 01b5746 Compare September 17, 2020 18:12
@rbngzlv
Copy link
Contributor Author

rbngzlv commented Oct 25, 2020

Hi @serggl, sorry for mentioning you directly, can you take a look at this PR? Or can you direct this PR to another team member? Thank you.

@serggl serggl merged commit 16ca4d9 into sunspot:master Oct 26, 2020
gr8bit added a commit to bichinger/sunspot that referenced this pull request Feb 28, 2021
…update

* 'v3-dev' of github.com:sunspot/sunspot:
  update formating to eager loading guide in README (sunspot#996)
  Fix backwards compatibility loading engine models on Rails 3.0 (sunspot#972)
  Adding correct link for readme resource under Tutorials and Articles section
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.

None yet

2 participants