{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/32022","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/32022/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/32022/comments","events_url":"https://api.github.com/repos/rails/rails/issues/32022/events","html_url":"https://github.com/rails/rails/issues/32022","id":297882413,"number":32022,"title":"throw :abort does not propagate to parent class","user":{"login":"fegorodscy","id":1015894,"avatar_url":"https://avatars3.githubusercontent.com/u/1015894?v=4","gravatar_id":"","url":"https://api.github.com/users/fegorodscy","html_url":"https://github.com/fegorodscy","followers_url":"https://api.github.com/users/fegorodscy/followers","following_url":"https://api.github.com/users/fegorodscy/following{/other_user}","gists_url":"https://api.github.com/users/fegorodscy/gists{/gist_id}","starred_url":"https://api.github.com/users/fegorodscy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fegorodscy/subscriptions","organizations_url":"https://api.github.com/users/fegorodscy/orgs","repos_url":"https://api.github.com/users/fegorodscy/repos","events_url":"https://api.github.com/users/fegorodscy/events{/privacy}","received_events_url":"https://api.github.com/users/fegorodscy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-16T18:43:10Z","updated_at":"2018-02-21T04:04:33Z","closed_at":null,"author_association":"NONE","body":"### Steps to reproduce\r\n\r\n- Define the following classes\r\n\r\n```ruby\r\nclass Parent\r\n  has_one :child, dependent: :destroy\r\nend\r\n\r\nclass Child\r\n  belongs_to :parent, inverse_of: :child\r\n  before_destroy { throw :abort }\r\nend\r\n```\r\n\r\n- Instanciate as follows:\r\n\r\n```ruby\r\nc = Child.create\r\np = Parent.create(child: c)\r\n```\r\n\r\n- Then, destroy the parent\r\n```ruby\r\np.destroy\r\n```\r\n\r\n### Expected behavior\r\nNeither the parent nor the child should be deleted.\r\n`throw :abort` should propagate to the parent who called :destroy on the child.\r\n```ruby\r\np.destroyed? # false\r\np.child.destroyed? # false\r\n```\r\n\r\n### Actual behavior\r\nThe parent is being destroyed.\r\n\r\n```ruby\r\np.destroyed? # true\r\np.child.destroyed? # false\r\n```\r\nPS: If a foreign key is set (which might not be the case for polymorphic associations), then parent is not deleted because it would violate a foreign key contraint, but rails would try it anyways.\r\n\r\n### System configuration\r\n**Rails version**: 5.1.5\r\n\r\n**Ruby version**: 2.5.0\r\n"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/367206957","html_url":"https://github.com/rails/rails/issues/32022#issuecomment-367206957","issue_url":"https://api.github.com/repos/rails/rails/issues/32022","id":367206957,"user":{"login":"claudiob","id":10076,"avatar_url":"https://avatars1.githubusercontent.com/u/10076?v=4","gravatar_id":"","url":"https://api.github.com/users/claudiob","html_url":"https://github.com/claudiob","followers_url":"https://api.github.com/users/claudiob/followers","following_url":"https://api.github.com/users/claudiob/following{/other_user}","gists_url":"https://api.github.com/users/claudiob/gists{/gist_id}","starred_url":"https://api.github.com/users/claudiob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudiob/subscriptions","organizations_url":"https://api.github.com/users/claudiob/orgs","repos_url":"https://api.github.com/users/claudiob/repos","events_url":"https://api.github.com/users/claudiob/events{/privacy}","received_events_url":"https://api.github.com/users/claudiob/received_events","type":"User","site_admin":false},"created_at":"2018-02-21T04:04:33Z","updated_at":"2018-02-21T04:04:33Z","author_association":"MEMBER","body":"🔬  `git bisect` shows that the behavior changed in 3a25cdca3e0d29e"}}
{"actor":{"display_login":"claudiob"}}