jipiboily / spree_multi_lingual

Spree multi-lingual is a plugin to make multi locale store with Spree possible
BSD 3-Clause "New" or "Revised" License
49 stars 56 forks source link

Migration error on 1-1-stable #8

Closed matteofuzz closed 12 years ago

matteofuzz commented 12 years ago

I have an error running migrations on 1-1-stable branch:

** Execute db:migrate
==  MigrateDataForProducts: migrating =========================================
rake aborted!
An error has occurred, all later migrations canceled:

Can't mass-assign protected attributes: id, created_at, updated_at, count_on_hand

Then I temporary add this line

attr_accessible :id, :created_at, :updated_at, :count_on_hand

to Spree::Product model and they run smooth.

I don't know how o solve this issue without override the model.

sbounmy commented 12 years ago

changing the migration to

product.update_attributes!(product.untranslated_attributes, :without_protection => true)

would fix it. I will patch this migration for ppl who are running on fresh spree 1.1 installs

matteofuzz commented 12 years ago

I confirm that with the patch migration run without problems (tested on deployment).