{"action":"created","issue":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch-rails/issues/340","labels_url":"https://api.github.com/repos/elasticsearch/elasticsearch-rails/issues/340/labels{/name}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch-rails/issues/340/comments","events_url":"https://api.github.com/repos/elasticsearch/elasticsearch-rails/issues/340/events","html_url":"https://github.com/elasticsearch/elasticsearch-rails/issues/340","id":59724883,"number":340,"title":"NoMethodError for Elasticsearch::Model methods after including via concern","user":{"login":"jraczak","id":1156584,"avatar_url":"https://avatars.githubusercontent.com/u/1156584?v=3","gravatar_id":"","url":"https://api.github.com/users/jraczak","html_url":"https://github.com/jraczak","followers_url":"https://api.github.com/users/jraczak/followers","following_url":"https://api.github.com/users/jraczak/following{/other_user}","gists_url":"https://api.github.com/users/jraczak/gists{/gist_id}","starred_url":"https://api.github.com/users/jraczak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jraczak/subscriptions","organizations_url":"https://api.github.com/users/jraczak/orgs","repos_url":"https://api.github.com/users/jraczak/repos","events_url":"https://api.github.com/users/jraczak/events{/privacy}","received_events_url":"https://api.github.com/users/jraczak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-03T23:28:33Z","updated_at":"2015-03-05T15:21:28Z","closed_at":null,"body":"@karmi  - Sandra Boyd recommended I work through issues to share the trouble I'm having. Details below - thanks in advance.\r\n\r\nI've included Elasticsearch::Model through a concern, as is recommended. When attempting to perform model operations such as create_index!, both with and without the _elasticsearch_ namespace, I am met with NoMethodErrors. `import` and `search`, however, seem to work with no issues. Here's my setup.\r\n\r\n    #app/models/concerns/elasticsearch_user.rb\r\n      require 'active_support/concern'\r\n\r\n      module ElasticsearchUser\r\n        extend ActiveSupport::Concern\r\n \r\n        included do\r\n          require 'elasticsearch/model'\r\n          include Elasticsearch::Model\r\n          include Elasticsearch::Model::Indexing\r\n   \r\n         #mapping do\r\n         #  to-do\r\n         #end\r\n    \r\n         #def self.search(query)\r\n         #  write a different search later\r\n         #end\r\n      end\r\n    end`\r\n\r\n\r\n    # User.rb\r\n    ...\r\n    # Elasticsearch configuration\r\n    include ElasticsearchUser\r\n    # index_name \"users\" <-- This value is inferred automatically by the model name\r\n    settings index: { number_of_shards: 1 }\r\n\r\nI've also tried including Elasticsearch::Model directly in my model definition to no avail. Thanks much for any guidance...\r\n"},"comment":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch-rails/issues/comments/77382383","html_url":"https://github.com/elasticsearch/elasticsearch-rails/issues/340#issuecomment-77382383","issue_url":"https://api.github.com/repos/elasticsearch/elasticsearch-rails/issues/340","id":77382383,"user":{"login":"karmi","id":4790,"avatar_url":"https://avatars.githubusercontent.com/u/4790?v=3","gravatar_id":"","url":"https://api.github.com/users/karmi","html_url":"https://github.com/karmi","followers_url":"https://api.github.com/users/karmi/followers","following_url":"https://api.github.com/users/karmi/following{/other_user}","gists_url":"https://api.github.com/users/karmi/gists{/gist_id}","starred_url":"https://api.github.com/users/karmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karmi/subscriptions","organizations_url":"https://api.github.com/users/karmi/orgs","repos_url":"https://api.github.com/users/karmi/repos","events_url":"https://api.github.com/users/karmi/events{/privacy}","received_events_url":"https://api.github.com/users/karmi/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T15:21:28Z","updated_at":"2015-03-05T15:21:28Z","body":"@jraczak No, these method are only available via the proxy; see https://github.com/elasticsearch/elasticsearch-rails/blob/master/elasticsearch-model/lib/elasticsearch/model.rb#L65\r\n\r\nI don't have any explanation why a concern model wouldn't work, precisely because the \"03-expert\" template runs fine with it...\r\n\r\nI suggest you try to \"break\" the working [`activerecord_article.rb]`(https://github.com/elasticsearch/elasticsearch-rails/blob/master/elasticsearch-model/examples/activerecord_article.rb#L31-L32) example, by declaring the integration in a concern."}}