This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| #put in lib/tasks/fixtures.rake | |
| namespace :db do | |
| namespace :fixtures do | |
| desc 'Create YAML test fixtures from data in an existing database. | |
| Defaults to development database. Set RAILS_ENV to override.' | |
| task :dump => :environment do | |
| sql = "SELECT * FROM %s" | |
| skip_tables = ["schema_migrations"] | |
| ActiveRecord::Base.establish_connection(:development) | |
| (ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer