small medium large xlarge

06 Mar 2013, 20:18
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
Sam Ruby (634 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:

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

You must be logged in to comment