06 Mar 2013, 20:18
Generic-user-small

Sean Coleman (3 posts)

Using Rails 4.0:

After rolling back the combine_items_in_cart migration, we expect to be able to view the contents of the cart without the items combined.

I get ActiveRecord::PendingMigrationError instead.

In the changelog for Rails 4.0, we have: “Added ActiveRecord::Migration.check_pending! that raises an error if migrations are pending.”

How can we do what the book does, and roll back a migration and view the app in the pre-migration state? Is this really a new thing for Rails 4.0?

Thanks, Sean

06 Mar 2013, 20:45
Samr_small_pragsmall

Sam Ruby (584 posts)

With Rails 4, you need to rename the file (so it isn’t considered pending). Look for the ‘mv’ commands before and after the third get /carts/1 in the following page:

http://intertwingly.net/projects/AWDwR4/checkdepot/section-10.1.html

I’ll update the book to mention this. Thanks!

  You must be logged in to comment