{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/856","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/856/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/856/comments","events_url":"https://api.github.com/repos/rails/rails/issues/856/events","html_url":"https://github.com/rails/rails/issues/856","id":904617,"number":856,"title":"Pass validated record to the custom message proc","user":{"login":"lighthouse-import","id":789801,"avatar_url":"https://avatars.githubusercontent.com/u/789801?v=3","gravatar_id":"","url":"https://api.github.com/users/lighthouse-import","html_url":"https://github.com/lighthouse-import","followers_url":"https://api.github.com/users/lighthouse-import/followers","following_url":"https://api.github.com/users/lighthouse-import/following{/other_user}","gists_url":"https://api.github.com/users/lighthouse-import/gists{/gist_id}","starred_url":"https://api.github.com/users/lighthouse-import/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lighthouse-import/subscriptions","organizations_url":"https://api.github.com/users/lighthouse-import/orgs","repos_url":"https://api.github.com/users/lighthouse-import/repos","events_url":"https://api.github.com/users/lighthouse-import/events{/privacy}","received_events_url":"https://api.github.com/users/lighthouse-import/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2011-05-16T04:35:19Z","updated_at":"2016-03-08T16:29:40Z","closed_at":"2011-05-21T15:12:25Z","body":"*Imported from Lighthouse.* Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6452\nCreated by **Łukasz Bandzarewicz** - 2011-02-18 17:55:02 UTC\n\nI've added a small improvement to the validation errors processing.\nIt allows to pass the validated record to the proc for generating a custom error message. For instance we could use it this way:\n\n``` ruby\nclass Subscription < ActiveRecord::Base\n\n  validates :city, :presence => true\n  validates_uniqueness_of :email, :scope => [:city_id], \n    :message => proc { |s| \"You're already subscribed to #{city.name}\" }\n\nend\n```"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/193850694","html_url":"https://github.com/rails/rails/issues/856#issuecomment-193850694","issue_url":"https://api.github.com/repos/rails/rails/issues/856","id":193850694,"user":{"login":"tansaku","id":30216,"avatar_url":"https://avatars.githubusercontent.com/u/30216?v=3","gravatar_id":"","url":"https://api.github.com/users/tansaku","html_url":"https://github.com/tansaku","followers_url":"https://api.github.com/users/tansaku/followers","following_url":"https://api.github.com/users/tansaku/following{/other_user}","gists_url":"https://api.github.com/users/tansaku/gists{/gist_id}","starred_url":"https://api.github.com/users/tansaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tansaku/subscriptions","organizations_url":"https://api.github.com/users/tansaku/orgs","repos_url":"https://api.github.com/users/tansaku/repos","events_url":"https://api.github.com/users/tansaku/events{/privacy}","received_events_url":"https://api.github.com/users/tansaku/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T16:29:40Z","updated_at":"2016-03-08T16:29:40Z","body":"we'd like this too!"}}