{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/algoliasearch-rails/issues/116","repository_url":"https://api.github.com/repos/algolia/algoliasearch-rails","labels_url":"https://api.github.com/repos/algolia/algoliasearch-rails/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/algolia/algoliasearch-rails/issues/116/comments","events_url":"https://api.github.com/repos/algolia/algoliasearch-rails/issues/116/events","html_url":"https://github.com/algolia/algoliasearch-rails/issues/116","id":157026060,"number":116,"title":"Algolia reindex issue","user":{"login":"mihaj","id":557954,"avatar_url":"https://avatars.githubusercontent.com/u/557954?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaj","html_url":"https://github.com/mihaj","followers_url":"https://api.github.com/users/mihaj/followers","following_url":"https://api.github.com/users/mihaj/following{/other_user}","gists_url":"https://api.github.com/users/mihaj/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaj/subscriptions","organizations_url":"https://api.github.com/users/mihaj/orgs","repos_url":"https://api.github.com/users/mihaj/repos","events_url":"https://api.github.com/users/mihaj/events{/privacy}","received_events_url":"https://api.github.com/users/mihaj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-26T16:34:01Z","updated_at":"2016-06-14T08:18:40Z","closed_at":null,"body":"I have a few models set up to use with algolia index.\r\n\r\nCompany model:\r\n\r\n```\r\n  algoliasearch per_environment: true, auto_index: false, auto_remove: false do\r\n    attributes :name, :description, :permalink, :rank\r\n    add_attribute :a_tags, :a_country, :a_image, :a_url, :a_location, :a_meta\r\n    attributesToIndex ['name', 'a_tags', 'a_location']\r\n    customRanking ['desc(rank)']\r\n  end\r\n...\r\n```\r\n\r\nSearch Tag model:\r\n\r\n```\r\n  algoliasearch per_environment: true, auto_index: false, auto_remove: false do\r\n    attributes :name\r\n    add_attribute :a_search_tag_total_results\r\n    add_attribute :a_url\r\n    add_attribute :a_names\r\n    attributesToIndex ['a_names']\r\n    customRanking ['desc(a_search_tag_total_results)']\r\n  end\r\n\r\n  def a_search_tag_total_results\r\n    self.counter\r\n  end\r\n\r\n  def a_url\r\n    \"/en/companies?keyword_search%5B%5D=#{self.name}\"\r\n  end\r\n\r\n  def a_names\r\n    {'en' => self.name}\r\n  end\r\n```\r\n\r\nWhen I run Company.reindex! I get this error:\r\n\r\n> NoMethodError: undefined method `a_search_tag_total_results' for #<Company:0x00000006eadea8>\r\n\r\n\r\nOf course a_search_tag_total_results is not setup at Company but SearchTag. What am I missing?\r\n\r\nThanks!\r\n\r\nMiha"},"comment":{"url":"https://api.github.com/repos/algolia/algoliasearch-rails/issues/comments/225811472","html_url":"https://github.com/algolia/algoliasearch-rails/issues/116#issuecomment-225811472","issue_url":"https://api.github.com/repos/algolia/algoliasearch-rails/issues/116","id":225811472,"user":{"login":"alexandremeunier","id":961573,"avatar_url":"https://avatars.githubusercontent.com/u/961573?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandremeunier","html_url":"https://github.com/alexandremeunier","followers_url":"https://api.github.com/users/alexandremeunier/followers","following_url":"https://api.github.com/users/alexandremeunier/following{/other_user}","gists_url":"https://api.github.com/users/alexandremeunier/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandremeunier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandremeunier/subscriptions","organizations_url":"https://api.github.com/users/alexandremeunier/orgs","repos_url":"https://api.github.com/users/alexandremeunier/repos","events_url":"https://api.github.com/users/alexandremeunier/events{/privacy}","received_events_url":"https://api.github.com/users/alexandremeunier/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T08:18:40Z","updated_at":"2016-06-14T08:18:40Z","body":"Hi @mihaj, we haven't been able to replicate the issue locally.\r\n\r\nCould you provide us with the full error stack trace ? Are you using STIs ? Any additional information about your models would be helpful."}}
{"actor":{"display_login":"alexandremeunier"}}