{"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":[],"state":"open","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},"milestone":null,"comments":1,"created_at":"2016-04-10T19:48:39Z","updated_at":"2016-04-10T19:48:41Z","closed_at":null,"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/208050694","html_url":"https://github.com/rails/rails/pull/24499#issuecomment-208050694","issue_url":"https://api.github.com/repos/rails/rails/issues/24499","id":208050694,"user":{"login":"rails-bot","id":7468109,"avatar_url":"https://avatars.githubusercontent.com/u/7468109?v=3","gravatar_id":"","url":"https://api.github.com/users/rails-bot","html_url":"https://github.com/rails-bot","followers_url":"https://api.github.com/users/rails-bot/followers","following_url":"https://api.github.com/users/rails-bot/following{/other_user}","gists_url":"https://api.github.com/users/rails-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/rails-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails-bot/subscriptions","organizations_url":"https://api.github.com/users/rails-bot/orgs","repos_url":"https://api.github.com/users/rails-bot/repos","events_url":"https://api.github.com/users/rails-bot/events{/privacy}","received_events_url":"https://api.github.com/users/rails-bot/received_events","type":"User","site_admin":false},"created_at":"2016-04-10T19:48:41Z","updated_at":"2016-04-10T19:48:41Z","body":"Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @arthurnn (or someone else) soon.\n\nIf any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.\n\nPlease see [the contribution instructions](http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html) for more information.\n"}}