RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: rojotek
Site: http://www.rojotek.com/blog
Hi Ryan,
I just came up with the following code to help ensure that you get consistent ID's when using the delete and repopulate seed approach.
Model.delete_all Model.accessible_attributes<<"id" Model.create([{id: 1, ...}, {id: 2, ...}, {id: 3, ...}, ... ] MessageType.accessible_attributes-["id"]
Hi Ryan,
I just came up with the following code to help ensure that you get consistent ID's when using the delete and repopulate seed approach.