refinery / refinerycms

An extendable Ruby on Rails CMS that supports Rails 6.0+
https://www.refinerycms.com/
MIT License
3.9k stars 1.26k forks source link

Searching within custom extension results in error "undefined method `with_query' " #3041

Closed slavajacobson closed 9 years ago

slavajacobson commented 9 years ago

undefined method `with_query' for #Refinery::Listings::Listing::ActiveRecord_Relation:0x007fc3443bf948

Followed this guide to create an extension:

http://www.refinerycms.com/guides/getting-started#extending-refinery-with-your-first-engine

GIT
  remote: git://github.com/refinery/refinerycms.git
  revision: 57037abc9055fdb59149db70c6b1bf5fb25f6ae1
  branch: master
  specs:
    refinerycms (3.0.0)
      refinerycms-core (= 3.0.0)
      refinerycms-images (= 3.0.0)
      refinerycms-pages (= 3.0.0)
      refinerycms-resources (= 3.0.0)
    refinerycms-core (3.0.0)
      actionpack (>= 4.2.3, < 5.0)
      activerecord (>= 4.2.3, < 5.0)
      awesome_nested_set (~> 3.0.0)
      coffee-rails (~> 4.0, >= 4.0.0)
      decorators (~> 2.0.0)
      jquery-rails (>= 2.3.0)
      jquery-ui-rails (~> 5.0.0)
      railties (>= 4.2.3, < 5.0)
      refinerycms-i18n (~> 3.0.0)
      sass-rails (>= 4.0, < 5.1)
      truncate_html (~> 0.9)
      will_paginate (~> 3.0.2)
      zilch-authorisation
    refinerycms-images (3.0.0)
      dragonfly (~> 1.0.0)
      globalize (>= 4.0.0, < 5.2)
      refinerycms-core (= 3.0.0)
    refinerycms-pages (3.0.0)
      awesome_nested_set (~> 3.0.0)
      babosa (!= 0.3.6)
      friendly_id (~> 5.1.0)
      globalize (>= 4.0.0, < 5.2)
      refinerycms-core (= 3.0.0)
      seo_meta (~> 2.0.0.rc.1)
      speakingurl-rails (~> 1.1.2)
    refinerycms-resources (3.0.0)
      acts_as_indexed (~> 0.8.0)
      dragonfly (~> 1.0.0)
      globalize (>= 4.0.0, < 5.2)
      refinerycms-core (= 3.0.0)
bricesanchez commented 9 years ago

Do you uncomment this line in your extension model ? https://github.com/refinery/refinerycms/blob/30a0b74daf2870bd3693e1dd951c4d6a001e3cb1/core/lib/generators/refinery/engine/templates/app/models/refinery/namespace/singular_name.rb.erb#L31-L33

slavajacobson commented 9 years ago

Ahhh, I was not aware of this. Thanks!

bricesanchez commented 9 years ago

You're welcome :)