Permalink
Browse files

fix mass assignment

  • Loading branch information...
1 parent 42211c3 commit ef4f762d33fd0d250914994e3756e77919e4f9b0 @gudata gudata committed Apr 21, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −1 app/models/spree/wished_product.rb
  2. +7 −0 spec/models/spree/wished_product_spec.rb
@@ -2,5 +2,5 @@ class Spree::WishedProduct < ActiveRecord::Base
belongs_to :variant
belongs_to :wishlist
- attr_accessible :wishlist_id, :variant
+ attr_accessible :wishlist_id, :variant, :variant_id
end
@@ -8,4 +8,11 @@
it "should be valid" do
@wished_product.should be_valid
end
+
+ it "should permit mass assigment of variant_id" do
+ lambda {
+ Spree::WishedProduct.new :variant_id => 33506
+ }.should_not raise_error
+
+ end
end

0 comments on commit ef4f762

Please sign in to comment.