{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/24499","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/24499/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/24499/comments","events_url":"https://api.github.com/repos/rails/rails/issues/24499/events","html_url":"https://github.com/rails/rails/pull/24499","id":147257123,"number":24499,"title":"Fix PgArray to always deserialize strings with the scripts encoding","user":{"login":"clupprich","id":773,"avatar_url":"https://avatars.githubusercontent.com/u/773?v=3","gravatar_id":"","url":"https://api.github.com/users/clupprich","html_url":"https://github.com/clupprich","followers_url":"https://api.github.com/users/clupprich/followers","following_url":"https://api.github.com/users/clupprich/following{/other_user}","gists_url":"https://api.github.com/users/clupprich/gists{/gist_id}","starred_url":"https://api.github.com/users/clupprich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clupprich/subscriptions","organizations_url":"https://api.github.com/users/clupprich/orgs","repos_url":"https://api.github.com/users/clupprich/repos","events_url":"https://api.github.com/users/clupprich/events{/privacy}","received_events_url":"https://api.github.com/users/clupprich/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/activerecord","name":"activerecord","color":"0b02e1"},{"url":"https://api.github.com/repos/rails/rails/labels/PostgreSQL","name":"PostgreSQL","color":"fbca04"}],"state":"closed","locked":false,"assignee":{"login":"arthurnn","id":833383,"avatar_url":"https://avatars.githubusercontent.com/u/833383?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurnn","html_url":"https://github.com/arthurnn","followers_url":"https://api.github.com/users/arthurnn/followers","following_url":"https://api.github.com/users/arthurnn/following{/other_user}","gists_url":"https://api.github.com/users/arthurnn/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurnn/subscriptions","organizations_url":"https://api.github.com/users/arthurnn/orgs","repos_url":"https://api.github.com/users/arthurnn/repos","events_url":"https://api.github.com/users/arthurnn/events{/privacy}","received_events_url":"https://api.github.com/users/arthurnn/received_events","type":"User","site_admin":true},"assignees":[{"login":"arthurnn","id":833383,"avatar_url":"https://avatars.githubusercontent.com/u/833383?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurnn","html_url":"https://github.com/arthurnn","followers_url":"https://api.github.com/users/arthurnn/followers","following_url":"https://api.github.com/users/arthurnn/following{/other_user}","gists_url":"https://api.github.com/users/arthurnn/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurnn/subscriptions","organizations_url":"https://api.github.com/users/arthurnn/orgs","repos_url":"https://api.github.com/users/arthurnn/repos","events_url":"https://api.github.com/users/arthurnn/events{/privacy}","received_events_url":"https://api.github.com/users/arthurnn/received_events","type":"User","site_admin":true}],"milestone":null,"comments":5,"created_at":"2016-04-10T19:48:39Z","updated_at":"2016-09-01T09:45:59Z","closed_at":"2016-09-01T09:45:59Z","pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/24499","html_url":"https://github.com/rails/rails/pull/24499","diff_url":"https://github.com/rails/rails/pull/24499.diff","patch_url":"https://github.com/rails/rails/pull/24499.patch"},"body":"### Summary\r\n\r\nFixes an issue with Arrays in PostgreSQL, where the encoding of the values of the array is changed upon deserialization. The issue is also described in #22730:\r\n\r\n### Other Information\r\n\r\nThis PR is based on #23619 which was closed because the original idea was that this should be fixed upstream in the PG adapter (ged/ruby-pg#11), but @larskanis later commented in https://github.com/rails/rails/pull/23619#issuecomment-189924036 that it's an issue with Rails/activerecord, not the adapter.\r\n\r\nI see that setting the encoding to `__ENCODING__` might not be good enough. Ideally, it should be set to the encoding of the connection. Is it safe to access the `ConnectionSpecification` instance via `ActiveRecord::Base.connection_pool.spec.config`? If so, then I would amend this PR to default to the encoding there and fallback to `__ENCODING__` when not available?"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/244030108","html_url":"https://github.com/rails/rails/pull/24499#issuecomment-244030108","issue_url":"https://api.github.com/repos/rails/rails/issues/24499","id":244030108,"user":{"login":"clupprich","id":773,"avatar_url":"https://avatars.githubusercontent.com/u/773?v=3","gravatar_id":"","url":"https://api.github.com/users/clupprich","html_url":"https://github.com/clupprich","followers_url":"https://api.github.com/users/clupprich/followers","following_url":"https://api.github.com/users/clupprich/following{/other_user}","gists_url":"https://api.github.com/users/clupprich/gists{/gist_id}","starred_url":"https://api.github.com/users/clupprich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clupprich/subscriptions","organizations_url":"https://api.github.com/users/clupprich/orgs","repos_url":"https://api.github.com/users/clupprich/repos","events_url":"https://api.github.com/users/clupprich/events{/privacy}","received_events_url":"https://api.github.com/users/clupprich/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T09:45:59Z","updated_at":"2016-09-01T09:45:59Z","body":"Thanks for fixing this, @sgrif!"}}
{"actor":{"display_login":"clupprich"}}