Skip to content

Commit

Permalink
Revert "Prevent tax category removal if tax rates are assigned to it."
Browse files Browse the repository at this point in the history
This reverts commit ed5914b.
  • Loading branch information
schof committed Nov 15, 2011
1 parent 9fe705f commit dd8556d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion core/app/models/spree/tax_category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Spree
class TaxCategory < ActiveRecord::Base
validates :name, :presence => true, :uniqueness => true

has_many :tax_rates, :dependent => :restrict
has_many :tax_rates

before_save :set_default_category

Expand Down
10 changes: 0 additions & 10 deletions core/spec/models/tax_category_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,5 @@

end

context 'delete' do
let!(:tax_category) {Factory(:tax_category)}
let!(:tax_rate) {Factory(:tax_rate, :tax_category => tax_category)}
it "should not allow deletion when tax rates are assigned" do
p tax_category.inspect
lambda {tax_category.destroy}.should raise_error ActiveRecord::DeleteRestrictionError
p tax_category.inspect
end
end


end

0 comments on commit dd8556d

Please sign in to comment.