{"action":"closed","issue":{"url":"https://api.github.com/repos/composite-primary-keys/composite_primary_keys/issues/384","repository_url":"https://api.github.com/repos/composite-primary-keys/composite_primary_keys","labels_url":"https://api.github.com/repos/composite-primary-keys/composite_primary_keys/issues/384/labels{/name}","comments_url":"https://api.github.com/repos/composite-primary-keys/composite_primary_keys/issues/384/comments","events_url":"https://api.github.com/repos/composite-primary-keys/composite_primary_keys/issues/384/events","html_url":"https://github.com/composite-primary-keys/composite_primary_keys/issues/384","id":208303862,"number":384,"title":"PG::UndefinedColumn: ERROR:  column \"role_id,permission_id\" does not exist","user":{"login":"Dorian","id":129149,"avatar_url":"https://avatars3.githubusercontent.com/u/129149?v=4","gravatar_id":"","url":"https://api.github.com/users/Dorian","html_url":"https://github.com/Dorian","followers_url":"https://api.github.com/users/Dorian/followers","following_url":"https://api.github.com/users/Dorian/following{/other_user}","gists_url":"https://api.github.com/users/Dorian/gists{/gist_id}","starred_url":"https://api.github.com/users/Dorian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dorian/subscriptions","organizations_url":"https://api.github.com/users/Dorian/orgs","repos_url":"https://api.github.com/users/Dorian/repos","events_url":"https://api.github.com/users/Dorian/events{/privacy}","received_events_url":"https://api.github.com/users/Dorian/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2017-02-17T01:23:35Z","updated_at":"2017-10-09T01:15:40Z","closed_at":"2017-10-09T01:15:40Z","author_association":"NONE","body":"Just wanted to document it somewhere, I tried upgrading my gems and encountered this error highly probably related to `composite_primary_keys` and I didn't find how to fix it yet, so it's blocking my upgrades (will continue to investigate).\r\n\r\nExamples include:\r\n\r\n```\r\nclass RolePermission < Model\r\n  self.primary_keys = :role_id, :permission_id\r\nend\r\n\r\nr = RolePermission.new # <RolePermissionJoin:... role_id: nil, permission_id: nil>\r\nr.role_id = 1\r\nr.permission_id = 1\r\nr.save\r\n\r\n# or\r\n\r\nRolePermission.create(role_id: 1, permission_id: 1)\r\n\r\n# SQL query: INSERT INTO \"roles_permissions\" (\"role_id\", \"permission_id\") VALUES ($1, $2) RETURNING \"role_id,permission_id\"\r\n\r\n# or\r\n\r\nRolePermission.find_or_create_by(role_id: 1, permission_id: 1)\r\n```\r\n\r\nExpected behavior:\r\n\r\n```\r\nINSERT INTO \"roles_permissions\" (\"role_id\", \"permission_id\") VALUES (1, 2) RETURNING \"role_id\", \"permission_id\"\r\n\r\n# or\r\n\r\nINSERT INTO \"roles_permissions\" (\"role_id\", \"permission_id\") VALUES (1, 2) RETURNING role_id, permission_id\r\n```\r\n\r\nSo it's somewhere in the escaping of field names :)\r\n\r\nTried on `composite_primary_keys`: `9.0.4`, `9.0.6` and `master`."}}
{"actor":{"display_login":"cfis"}}