{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/347","labels_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/347/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/347/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/347/events","html_url":"https://github.com/elastic/elasticsearch-rails/issues/347","id":62087423,"number":347,"title":"Optimistic Concurrency Control support?","user":{"login":"rgorel","id":397798,"avatar_url":"https://avatars.githubusercontent.com/u/397798?v=3","gravatar_id":"","url":"https://api.github.com/users/rgorel","html_url":"https://github.com/rgorel","followers_url":"https://api.github.com/users/rgorel/followers","following_url":"https://api.github.com/users/rgorel/following{/other_user}","gists_url":"https://api.github.com/users/rgorel/gists{/gist_id}","starred_url":"https://api.github.com/users/rgorel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgorel/subscriptions","organizations_url":"https://api.github.com/users/rgorel/orgs","repos_url":"https://api.github.com/users/rgorel/repos","events_url":"https://api.github.com/users/rgorel/events{/privacy}","received_events_url":"https://api.github.com/users/rgorel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/labels/waiting","name":"waiting","color":"207de5"}],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":5,"created_at":"2015-03-16T13:50:53Z","updated_at":"2015-03-17T17:18:47Z","closed_at":null,"body":"Hello,\r\n\r\nI want to implement saving the documents using [Optimistic Concurrency Control](http://www.elastic.co/guide/en/elasticsearch/guide/current/optimistic-concurrency-control.html) feature of Elasticsearch, but I was not able to do it with your gem.\r\n\r\nConsidering that I have\r\n```ruby\r\nclass Color\r\n    include Elasticsearch::Persistence::Model\r\n    # ...\r\nend\r\n```\r\nI have tried:\r\n```ruby\r\nc = Search::Color.find(517053)\r\nc.update product_strapline: 'www aaa', _version: 5\r\nrepository = Elasticsearch::Persistence::Repository.new\r\nrepository.update c, id: c.id, _version: 2\r\n```\r\nboth with no luck, which makes me think that this feature is not supported yet.\r\n\r\nAre there any future plans to include this feature in the next releases? Can you suggest any workaround how can I implement this using your gem?\r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/comments/82487095","html_url":"https://github.com/elastic/elasticsearch-rails/issues/347#issuecomment-82487095","issue_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/347","id":82487095,"user":{"login":"rgorel","id":397798,"avatar_url":"https://avatars.githubusercontent.com/u/397798?v=3","gravatar_id":"","url":"https://api.github.com/users/rgorel","html_url":"https://github.com/rgorel","followers_url":"https://api.github.com/users/rgorel/followers","following_url":"https://api.github.com/users/rgorel/following{/other_user}","gists_url":"https://api.github.com/users/rgorel/gists{/gist_id}","starred_url":"https://api.github.com/users/rgorel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgorel/subscriptions","organizations_url":"https://api.github.com/users/rgorel/orgs","repos_url":"https://api.github.com/users/rgorel/repos","events_url":"https://api.github.com/users/rgorel/events{/privacy}","received_events_url":"https://api.github.com/users/rgorel/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T17:18:47Z","updated_at":"2015-03-17T17:18:47Z","body":"@karmi ok, also I will try to contribute if I have time"}}