Skip to content

Overwriting of search method #20

Closed
@zzet

Description

@zzet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions