{"action":"closed","issue":{"url":"https://api.github.com/repos/rails/rails/issues/33420","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/33420/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/33420/comments","events_url":"https://api.github.com/repos/rails/rails/issues/33420/events","html_url":"https://github.com/rails/rails/issues/33420","id":343513045,"node_id":"MDU6SXNzdWUzNDM1MTMwNDU=","number":33420,"title":"`destory!` excludes record errors in exception when exist","user":{"login":"azbshiri","id":15009059,"node_id":"MDQ6VXNlcjE1MDA5MDU5","avatar_url":"https://avatars0.githubusercontent.com/u/15009059?v=4","gravatar_id":"","url":"https://api.github.com/users/azbshiri","html_url":"https://github.com/azbshiri","followers_url":"https://api.github.com/users/azbshiri/followers","following_url":"https://api.github.com/users/azbshiri/following{/other_user}","gists_url":"https://api.github.com/users/azbshiri/gists{/gist_id}","starred_url":"https://api.github.com/users/azbshiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azbshiri/subscriptions","organizations_url":"https://api.github.com/users/azbshiri/orgs","repos_url":"https://api.github.com/users/azbshiri/repos","events_url":"https://api.github.com/users/azbshiri/events{/privacy}","received_events_url":"https://api.github.com/users/azbshiri/received_events","type":"User","site_admin":false},"labels":[{"id":12449438,"node_id":"MDU6TGFiZWwxMjQ0OTQzOA==","url":"https://api.github.com/repos/rails/rails/labels/stale","name":"stale","color":"444444","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-23T07:10:59Z","updated_at":"2018-10-28T14:53:08Z","closed_at":"2018-10-28T14:53:08Z","author_association":"CONTRIBUTOR","body":"### Steps to reproduce\r\n```ruby\r\n# frozen_string_literal: true\r\n\r\nbegin\r\n  require \"bundler/inline\"\r\nrescue LoadError => e\r\n  $stderr.puts \"Bundler version 1.10 or later is required. Please update your Bundler\"\r\n  raise e\r\nend\r\n\r\ngemfile(true) do\r\n  source \"https://rubygems.org\"\r\n\r\n  git_source(:github) { |repo| \"https://github.com/#{repo}.git\" }\r\n\r\n  gem \"rails\", github: \"rails/rails\"\r\n  gem \"sqlite3\"\r\nend\r\n\r\nrequire \"active_record\"\r\nrequire \"minitest/autorun\"\r\nrequire \"logger\"\r\n\r\n# This connection will do for database-independent bug reports.\r\nActiveRecord::Base.establish_connection(adapter: \"sqlite3\", database: \":memory:\")\r\nActiveRecord::Base.logger = Logger.new(STDOUT)\r\n\r\nActiveRecord::Schema.define do\r\n  create_table :individuals, force: true do |t|\r\n  end\r\n\r\n  create_table :addresses, force: true do |t|\r\n    t.integer :individual_id\r\n  end\r\nend\r\n\r\nclass Individual < ActiveRecord::Base\r\n  has_one :address, dependent: :restrict_with_error\r\nend\r\n\r\nclass Address < ActiveRecord::Base\r\n  belongs_to :person\r\nend\r\n\r\nclass BugTest < Minitest::Test\r\n  def test_association_stuff\r\n    individual = Individual.create!\r\n    individual.address = Address.create!\r\n\r\n    exception = assert_raise(ActiveRecord::RecordNotDestroyed) do\r\n      individual.destroy!\r\n    end\r\n\r\n    assert_equal \"Cannot delete record because a dependent address exists\", exception.message\r\n  end\r\nend\r\n```\r\n### Expected behavior\r\n\"Cannot delete record because a dependent address exists\"\r\n\r\n### Actual behavior\r\n\"Failed to destroy the record\"\r\n\r\n### System configuration\r\n**Rails version**: 5.x\r\n\r\n**Ruby version**: 2.x\r\n"}}
{"actor":{"display_login":"rails-bot"}}