small medium large xlarge

Generic-user-small
20 Apr 2012, 20:45
Ingo Klemm (5 posts)

I am not able to run the up-migration. copy-pasted the source,so the problem is not there…

I use rails 3.2.3, think its due to the version.

== CombineItemsInCart: migrating ============================================= rake aborted! An error has occurred, this and all later migrations canceled:

Can’t mass-assign protected attributes: quantity

EDIT:

I added :quantity to attr_accessible of LineItem

=> now it works!

class LineItem < ActiveRecord::Base attr_accessible :cart_id, :product_id, :quantity belongs_to :product belongs_to :cart end

Generic-user-small
12 May 2013, 16:05
vaibhav nadgonde (3 posts)

Thank you ingo … it works for me as well now. I have few more queries if you would like to help me

You must be logged in to comment