fixing readme, adjusting rake so migrations auto-run for testing

Oleg committed Feb 04, 2011
commit be7c31a1d38796102c2dfdf00179f3699b6abccb
Showing 2 changed files with 9 additions and 4 deletions
README.md +2 -2
@@ @@ -124,14 +124,14 @@ Example fixture files for a [layout](https://github.com/twg/comfortable-mexican-
### Importing fixtures into database
Now that you have all those fixture files, how do we get them into database? Easy:
- rake comfortable_mexican_sofa:import:all FROM=your-site.local TO=your-site.com PATH=/path/to/fixtures
+ rake comfortable_mexican_sofa:import:all FROM=your-site.local TO=your-site.com SEED_PATH=/path/to/fixtures
PATH is optional if seed\_data\_path configuration option is set.
### Exporting database data into fixtures
If you need to pull down database content into fixtures it's done as follows:
- rake comfortable_mexican_sofa:export:all FROM=your-site.com TO=your-site.local PATH=/path/to/fixtures
+ rake comfortable_mexican_sofa:export:all FROM=your-site.com TO=your-site.local SEED_PATH=/path/to/fixtures
During import/export it will prompt you if there are any files/database entries that are going to be overwritten
tasks/comfortable_mexican_sofa.rake b/lib/tasks/comfortable_mexican_sofa.rake +7 -2
@@ @@ -1,7 +1,12 @@
+ # Small hack to auto-run migrations during testing
+ namespace :db do
+ task :abort_if_pending_migrations => [:migrate]
+ end
+
namespace :comfortable_mexican_sofa do
# Example use:
- # rake comfortable_mexican_sofa:import:all FROM=mysite.local TO=mysite.com PATH=/path/to/seed_data
+ # rake comfortable_mexican_sofa:import:all FROM=mysite.local TO=mysite.com SEED_PATH=/path/to/seed_data
namespace :import do
task :check_for_requirements => :environment do |task, args|
@@ @@ -163,7 +168,7 @@ namespace :comfortable_mexican_sofa do
end
# Example use:
- # rake comfortable_mexican_sofa:import:all FROM=mysite.com TO=mysite.local PATH=/path/to/seed_data
+ # rake comfortable_mexican_sofa:import:all FROM=mysite.com TO=mysite.local SEED_PATH=/path/to/seed_data
namespace :export do
task :check_for_requirements => :environment do |task, args|