{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/19688","labels_url":"https://api.github.com/repos/rails/rails/issues/19688/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/19688/comments","events_url":"https://api.github.com/repos/rails/rails/issues/19688/events","html_url":"https://github.com/rails/rails/pull/19688","id":67007027,"number":19688,"title":"Fix uniqueness validation with out of range value","user":{"login":"Antiarchitect","id":50209,"avatar_url":"https://avatars.githubusercontent.com/u/50209?v=3","gravatar_id":"","url":"https://api.github.com/users/Antiarchitect","html_url":"https://github.com/Antiarchitect","followers_url":"https://api.github.com/users/Antiarchitect/followers","following_url":"https://api.github.com/users/Antiarchitect/following{/other_user}","gists_url":"https://api.github.com/users/Antiarchitect/gists{/gist_id}","starred_url":"https://api.github.com/users/Antiarchitect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antiarchitect/subscriptions","organizations_url":"https://api.github.com/users/Antiarchitect/orgs","repos_url":"https://api.github.com/users/Antiarchitect/repos","events_url":"https://api.github.com/users/Antiarchitect/events{/privacy}","received_events_url":"https://api.github.com/users/Antiarchitect/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-07T22:48:18Z","updated_at":"2015-04-08T16:02:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/19688","html_url":"https://github.com/rails/rails/pull/19688","diff_url":"https://github.com/rails/rails/pull/19688.diff","patch_url":"https://github.com/rails/rails/pull/19688.patch"},"body":"Let's say you have both uniqueness and range validation for PostgreSQL 4 byte integer column:\r\n```ruby\r\nclass A < ActiveRecord::Base\r\n  PG_MAX_INT = 2147483647\r\n  validates :number, uniqueness: true, inclusion: { 0..PG_MAX_INT }\r\nend\r\n\r\na = A.create(number: (A::PG_MAX_INT + 1))\r\n```\r\nBefore it will raise this:\r\n```ruby\r\nRangeError: 2147483648 is out of range for ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer with limit 4\r\n```\r\n\r\nNow:\r\n```ruby\r\na.errors[:number] =>\r\n['is not included in the list'] \r\n```"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/90960143","html_url":"https://github.com/rails/rails/pull/19688#issuecomment-90960143","issue_url":"https://api.github.com/repos/rails/rails/issues/19688","id":90960143,"user":{"login":"rafaelfranca","id":47848,"avatar_url":"https://avatars.githubusercontent.com/u/47848?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T16:02:43Z","updated_at":"2015-04-08T16:02:43Z","body":"@sgrif seems good :+1:"}}