{"action":"closed","issue":{"url":"https://api.github.com/repos/spree/spree/issues/3781","labels_url":"https://api.github.com/repos/spree/spree/issues/3781/labels{/name}","comments_url":"https://api.github.com/repos/spree/spree/issues/3781/comments","events_url":"https://api.github.com/repos/spree/spree/issues/3781/events","html_url":"https://github.com/spree/spree/issues/3781","id":20176348,"number":3781,"title":"Spree::Product doesn't validate that tax_category_id exists.","user":{"login":"jhirbour","id":2355,"avatar_url":"https://avatars.githubusercontent.com/u/2355?v=3","gravatar_id":"","url":"https://api.github.com/users/jhirbour","html_url":"https://github.com/jhirbour","followers_url":"https://api.github.com/users/jhirbour/followers","following_url":"https://api.github.com/users/jhirbour/following{/other_user}","gists_url":"https://api.github.com/users/jhirbour/gists{/gist_id}","starred_url":"https://api.github.com/users/jhirbour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhirbour/subscriptions","organizations_url":"https://api.github.com/users/jhirbour/orgs","repos_url":"https://api.github.com/users/jhirbour/repos","events_url":"https://api.github.com/users/jhirbour/events{/privacy}","received_events_url":"https://api.github.com/users/jhirbour/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spree/spree/labels/stalled","name":"stalled","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2013-09-27T15:13:02Z","updated_at":"2015-01-09T19:01:54Z","closed_at":"2015-01-09T19:01:54Z","body":"Looks like the Spree::Product model is missing a check to see if a tax_category exists before creating a record.\r\n\r\nI'm using spree_core (2.1.2.beta) I have \"gem 'spree', git: 'https://github.com/spree/spree.git' , :branch => '2-1-stable'\" in my Gemfile. (not sure why it lists as 2.1.2 beta from bundle list)\r\n\r\n== How to reproduce\r\nCreate a product with tax_category_id that doesn't exist. \r\n\r\n\r\nSpree::Product.create!(\r\n      :name => \"some name\",\r\n      :description => \"some descr\",\r\n      :price => 3.50,\r\n      :available_on => \"2013-01-01T00:00:00Z\",\r\n      :tax_category_id => 99,\r\n      :shipping_category_id => 1,\r\n      :meta_description => \"some meta descr\",\r\n      :meta_keywords => \"some, key, workds\",\r\n      :permalink => \"url-of-failure\",\r\n    )\r\n"}}