undefined method `with_query' #41

Closed
gajeev opened this Issue Sep 3, 2013 · 8 comments

Comments

Projects
None yet
5 participants
@gajeev

gajeev commented Sep 3, 2013

After upgrading to refinerycms 2.1, i'm getting this error when trying to search:

NoMethodError - undefined method with_query' for #<Refinery::Page::FriendlyIdActiveRecordRelation:0x007fd7a9d973e8>: activerecord (3.2.14) lib/active_record/relation/delegation.rb:45:inmethod_missing'

Looks llike this issue: https://travis-lite.com/refinery/refinerycms-search/jobs/7725259

Versions:
gem "refinerycms", "~> 2.1.0"
gem "refinerycms-search", :git => "git://github.com/refinery/refinerycms-search.git"

@kgautreaux

This comment has been minimized.

Show comment Hide comment
@kgautreaux

kgautreaux Sep 13, 2013

Contributor

Just to confirm I am experiencing the same issue with the same gem versions.

Contributor

kgautreaux commented Sep 13, 2013

Just to confirm I am experiencing the same issue with the same gem versions.

@gajeev

This comment has been minimized.

Show comment Hide comment
@gajeev

gajeev Sep 14, 2013

Adding this gem got rid of the error:
gem 'refinerycms-acts-as-indexed', '~> 1.0.0'

gajeev commented Sep 14, 2013

Adding this gem got rid of the error:
gem 'refinerycms-acts-as-indexed', '~> 1.0.0'

kgautreaux added a commit to kgautreaux/refinerycms-search that referenced this issue Sep 14, 2013

Add refinerycms-acts-as-indexed to gemspec (github issue #41).
I believe this fixes issue #41 and will allow the Travis CI build to pass.
@kgautreaux

This comment has been minimized.

Show comment Hide comment
@kgautreaux

kgautreaux Sep 14, 2013

Contributor

Great work @gajeev! Fixed the issue for me. I submitted a quick pull request to add dependency to the gemspec, but you deserve all the credit for tracking down the fix to this issue.

Contributor

kgautreaux commented Sep 14, 2013

Great work @gajeev! Fixed the issue for me. I submitted a quick pull request to add dependency to the gemspec, but you deserve all the credit for tracking down the fix to this issue.

@gajeev

This comment has been minimized.

Show comment Hide comment
@gajeev

gajeev Sep 16, 2013

thanks @kgautreaux!

gajeev commented Sep 16, 2013

thanks @kgautreaux!

@parndt

This comment has been minimized.

Show comment Hide comment
@parndt

parndt Oct 22, 2013

Member

Merged the fix.

Member

parndt commented Oct 22, 2013

Merged the fix.

@parndt parndt closed this Oct 22, 2013

@charlesdeb

This comment has been minimized.

Show comment Hide comment
@charlesdeb

charlesdeb Dec 2, 2013

Dear folks,

I am getting the same error. Search works fine for refinerycms-pages, but i get the same error message as reported previously when trying to use the search in a generated engine.

My application gemfile.lock has these lines:

refinerycms-search (2.1.0)
refinerycms-acts-as-indexed (~> 1.0.0)
refinerycms (2.1.0)

Using rails 3.2.15

I also ensured that the search refinerycms-search and refinerycms-acts-as-indexed were in my engine gemfile (and did a bundle install for them too - although I don't think makes any difference for running the app - just for testing right?)

Not sure if it's of any relevance, but I am using i18n across my whole application.

Dear folks,

I am getting the same error. Search works fine for refinerycms-pages, but i get the same error message as reported previously when trying to use the search in a generated engine.

My application gemfile.lock has these lines:

refinerycms-search (2.1.0)
refinerycms-acts-as-indexed (~> 1.0.0)
refinerycms (2.1.0)

Using rails 3.2.15

I also ensured that the search refinerycms-search and refinerycms-acts-as-indexed were in my engine gemfile (and did a bundle install for them too - although I don't think makes any difference for running the app - just for testing right?)

Not sure if it's of any relevance, but I am using i18n across my whole application.

@dfang

This comment has been minimized.

Show comment Hide comment
@dfang

dfang Jan 6, 2014

@charlesdeb +1, same error !

dfang commented Jan 6, 2014

@charlesdeb +1, same error !

@dfang

This comment has been minimized.

Show comment Hide comment
@dfang

dfang Jan 6, 2014

@charlesdeb, i got it, you need to check every model in settings Refinery.searchable_models = [Refinery::Page, Refinery::News::Item, Refinery::Notices::Notice] to make sure every model has this line acts_as_indexed :fields => [:field], if you don't have acts_as_indexed :fields => [:field] in the model, you will got this error.

dfang commented Jan 6, 2014

@charlesdeb, i got it, you need to check every model in settings Refinery.searchable_models = [Refinery::Page, Refinery::News::Item, Refinery::Notices::Notice] to make sure every model has this line acts_as_indexed :fields => [:field], if you don't have acts_as_indexed :fields => [:field] in the model, you will got this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment