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

Overwriting of search method #20

Closed
zzet opened this issue Feb 19, 2014 · 1 comment
Closed

Overwriting of search method #20

zzet opened this issue Feb 19, 2014 · 1 comment
Labels

Comments

@zzet
Copy link

zzet commented Feb 19, 2014

Hi!

After update elasticsearch-rails form 46734cd to 88b6597 broken overwriting of search via

module Searchable
  extend ActiveSupport::Concern

  included do
    include Elasticsearch::Model

    mapping do
      # ...
    end

  end

  module ClassMethods
    def search(query)
      # ...
    end
  end

But it work with:

# In: app/models/concerns/searchable.rb
#
module Searchable
  extend ActiveSupport::Concern

  included do
    include Elasticsearch::Model

    mapping do
      # ...
    end

    def self.search(query)
      # ...
    end
  end
end

I think, problem with delegation and easy to update readme.

@karmi
Copy link
Contributor

karmi commented Mar 1, 2014

@zzet Thanks for the report, I'll look into it. So the problem is that the bundled search method overwrites your own search method defined in the model?

@karmi karmi added the waiting label Mar 1, 2014
@karmi karmi closed this as completed in 527e207 Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants