{"action":"opened","issue":{"url":"https://api.github.com/repos/rodomvp/KennelApp/issues/89","repository_url":"https://api.github.com/repos/rodomvp/KennelApp","labels_url":"https://api.github.com/repos/rodomvp/KennelApp/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/rodomvp/KennelApp/issues/89/comments","events_url":"https://api.github.com/repos/rodomvp/KennelApp/issues/89/events","html_url":"https://github.com/rodomvp/KennelApp/issues/89","id":150634889,"number":89,"title":"delete patient violates fk constraint","user":{"login":"rgulle4","id":12738315,"avatar_url":"https://avatars.githubusercontent.com/u/12738315?v=3","gravatar_id":"","url":"https://api.github.com/users/rgulle4","html_url":"https://github.com/rgulle4","followers_url":"https://api.github.com/users/rgulle4/followers","following_url":"https://api.github.com/users/rgulle4/following{/other_user}","gists_url":"https://api.github.com/users/rgulle4/gists{/gist_id}","starred_url":"https://api.github.com/users/rgulle4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgulle4/subscriptions","organizations_url":"https://api.github.com/users/rgulle4/orgs","repos_url":"https://api.github.com/users/rgulle4/repos","events_url":"https://api.github.com/users/rgulle4/events{/privacy}","received_events_url":"https://api.github.com/users/rgulle4/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rodomvp/KennelApp/labels/BUG:","name":"BUG:","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-24T06:44:32Z","updated_at":"2016-04-24T06:44:32Z","closed_at":null,"body":"> ERROR:  update or delete on table \"patients\" violates foreign key constraint \"fk_rails_a2f79262ff\" on table \"stays\"\r\nDETAIL:  Key (id)=(36) is still referenced from table \"stays\"\r\n\r\n`app/controllers/patients_controller.rb`\r\n\r\n```ruby\r\ndef destroy\r\n    @patient = Patient.find(params[:id]).destroy\r\n    flash[:success] = \"Deleted #{@patient.name}\"\r\n    redirect_to patients_url\r\n  end\r\n```\r\n\r\n\r\n![image](https://cloud.githubusercontent.com/assets/12738315/14765947/fb010392-09bd-11e6-850c-00c4062d7d0b.png)"}}