{"action":"created","issue":{"url":"https://api.github.com/repos/jesjos/active_record_upsert/issues/79","repository_url":"https://api.github.com/repos/jesjos/active_record_upsert","labels_url":"https://api.github.com/repos/jesjos/active_record_upsert/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/jesjos/active_record_upsert/issues/79/comments","events_url":"https://api.github.com/repos/jesjos/active_record_upsert/issues/79/events","html_url":"https://github.com/jesjos/active_record_upsert/issues/79","id":360606027,"node_id":"MDU6SXNzdWUzNjA2MDYwMjc=","number":79,"title":"Primary key not returned when upserting specific attributes","user":{"login":"abinoda","id":50083,"node_id":"MDQ6VXNlcjUwMDgz","avatar_url":"https://avatars0.githubusercontent.com/u/50083?v=4","gravatar_id":"","url":"https://api.github.com/users/abinoda","html_url":"https://github.com/abinoda","followers_url":"https://api.github.com/users/abinoda/followers","following_url":"https://api.github.com/users/abinoda/following{/other_user}","gists_url":"https://api.github.com/users/abinoda/gists{/gist_id}","starred_url":"https://api.github.com/users/abinoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abinoda/subscriptions","organizations_url":"https://api.github.com/users/abinoda/orgs","repos_url":"https://api.github.com/users/abinoda/repos","events_url":"https://api.github.com/users/abinoda/events{/privacy}","received_events_url":"https://api.github.com/users/abinoda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-09-16T05:39:04Z","updated_at":"2018-09-16T08:51:05Z","closed_at":null,"author_association":"NONE","body":"**This issue was introduced when I upgraded from 0.9.1 to 0.9.3.** See the example below`user.id` is `nil` in the final object. Again, this code works fine in v0.9.1 but not 0.9.3.\r\n\r\n```ruby\r\nclass User < ApplicationRecord\r\n  upsert_keys [:my_id]\r\nend\r\n\r\nuser = User.new(\r\n  name:   name,\r\n  email:  email,\r\n  my_id:  my_id\r\n)\r\n\r\n# Overwrite email field but not name\r\nuser.upsert!(attributes: [:name])\r\n\r\nuser.id.nil? # => true\r\n```"},"comment":{"url":"https://api.github.com/repos/jesjos/active_record_upsert/issues/comments/421726105","html_url":"https://github.com/jesjos/active_record_upsert/issues/79#issuecomment-421726105","issue_url":"https://api.github.com/repos/jesjos/active_record_upsert/issues/79","id":421726105,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTcyNjEwNQ==","user":{"login":"jesjos","id":281758,"node_id":"MDQ6VXNlcjI4MTc1OA==","avatar_url":"https://avatars0.githubusercontent.com/u/281758?v=4","gravatar_id":"","url":"https://api.github.com/users/jesjos","html_url":"https://github.com/jesjos","followers_url":"https://api.github.com/users/jesjos/followers","following_url":"https://api.github.com/users/jesjos/following{/other_user}","gists_url":"https://api.github.com/users/jesjos/gists{/gist_id}","starred_url":"https://api.github.com/users/jesjos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jesjos/subscriptions","organizations_url":"https://api.github.com/users/jesjos/orgs","repos_url":"https://api.github.com/users/jesjos/repos","events_url":"https://api.github.com/users/jesjos/events{/privacy}","received_events_url":"https://api.github.com/users/jesjos/received_events","type":"User","site_admin":false},"created_at":"2018-09-16T08:51:05Z","updated_at":"2018-09-16T08:51:05Z","author_association":"OWNER","body":"I’m not in a position to try anything out right now, but I can try later today. It seems the travis builds aren’t building the correct rails versions. I need to take a look at that as well. I’ll get back to you. "}}
{"actor":{"display_login":"jesjos"}}