12 months ago
If you're trying to migrate or backup your data you can do this quite elegant using rake and YAML. You can find infos and code here and there.
The only problem with these snippets are the migration of JOIN-Tables since tbl.classify.constantize won't work if tbl is 'users_roles' for example (unless you created a class for this table of course).

Solution: just define the class for each JOIN-table that does not have a class yet. Add this somewhere at the beginning of your new rake file :
class UsersRole < ActiveRecord::Base ; end
comments
blog comments powered by Disqus