{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/600","repository_url":"https://api.github.com/repos/elastic/elasticsearch-rails","labels_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/600/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/600/events","html_url":"https://github.com/elastic/elasticsearch-rails/issues/600","id":166898960,"number":600,"title":"No way to customize deserialization with Elasticsearch::Persistence ActiveRecord pattern","user":{"login":"jogaco","id":1876230,"avatar_url":"https://avatars.githubusercontent.com/u/1876230?v=3","gravatar_id":"","url":"https://api.github.com/users/jogaco","html_url":"https://github.com/jogaco","followers_url":"https://api.github.com/users/jogaco/followers","following_url":"https://api.github.com/users/jogaco/following{/other_user}","gists_url":"https://api.github.com/users/jogaco/gists{/gist_id}","starred_url":"https://api.github.com/users/jogaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jogaco/subscriptions","organizations_url":"https://api.github.com/users/jogaco/orgs","repos_url":"https://api.github.com/users/jogaco/repos","events_url":"https://api.github.com/users/jogaco/events{/privacy}","received_events_url":"https://api.github.com/users/jogaco/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-21T19:29:55Z","updated_at":"2016-07-22T12:50:01Z","closed_at":"2016-07-22T12:50:01Z","body":"Since this uses Virtus model, it initializes a new instance [here](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-persistence/lib/elasticsearch/persistence/model.rb#L103).\r\nIt is not enough to override initialize method, since for instance we don't know if the instance is [persisted](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-persistence/lib/elasticsearch/persistence/model.rb#L118) or not.\r\n\r\nI suggest adding an empty hook method deserialize, so it can be overriden in the indexed class."},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/comments/234534987","html_url":"https://github.com/elastic/elasticsearch-rails/issues/600#issuecomment-234534987","issue_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/600","id":234534987,"user":{"login":"jogaco","id":1876230,"avatar_url":"https://avatars.githubusercontent.com/u/1876230?v=3","gravatar_id":"","url":"https://api.github.com/users/jogaco","html_url":"https://github.com/jogaco","followers_url":"https://api.github.com/users/jogaco/followers","following_url":"https://api.github.com/users/jogaco/following{/other_user}","gists_url":"https://api.github.com/users/jogaco/gists{/gist_id}","starred_url":"https://api.github.com/users/jogaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jogaco/subscriptions","organizations_url":"https://api.github.com/users/jogaco/orgs","repos_url":"https://api.github.com/users/jogaco/repos","events_url":"https://api.github.com/users/jogaco/events{/privacy}","received_events_url":"https://api.github.com/users/jogaco/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T12:50:01Z","updated_at":"2016-07-22T12:50:01Z","body":"Not necessary with after_find callback"}}
{"actor":{"display_login":"jogaco"}}