From 5eceb8870c2dc4c1bc2567ed033e30a81e5f5c43 Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Tue, 19 Feb 2013 11:30:02 +1100 Subject: Upgrade load-sample-data to work with Rails 3 --- script/load-sample-data | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'script/load-sample-data') diff --git a/script/load-sample-data b/script/load-sample-data index 86e1af128..06fc9b579 100755 --- a/script/load-sample-data +++ b/script/load-sample-data @@ -4,14 +4,20 @@ # the fact that the fixtures aren't aware of the fact that RawEmails # have a filesystem representation of their contents -LOC=`dirname "$0"` +export LOC=`dirname "$0"` -bundle exec rake --silent spec:db:fixtures:load +bundle exec rails runner /dev/stdin < Date: Tue, 19 Feb 2013 11:38:15 +1100 Subject: Stop RSpec output when running load-sample-data --- script/load-sample-data | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'script/load-sample-data') diff --git a/script/load-sample-data b/script/load-sample-data index 06fc9b579..5fa860d3f 100755 --- a/script/load-sample-data +++ b/script/load-sample-data @@ -7,7 +7,13 @@ export LOC=`dirname "$0"` bundle exec rails runner /dev/stdin < Date: Wed, 20 Feb 2013 16:36:30 +1100 Subject: Specify the full path as Ruby 1.9.3 doesn't include the current directory in the load path --- script/load-sample-data | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'script/load-sample-data') diff --git a/script/load-sample-data b/script/load-sample-data index 5fa860d3f..f9e9d0f8a 100755 --- a/script/load-sample-data +++ b/script/load-sample-data @@ -8,8 +8,8 @@ export LOC=`dirname "$0"` bundle exec rails runner /dev/stdin < Date: Tue, 5 Mar 2013 12:22:25 +1100 Subject: Fixtures is namespaced in ActiveRecord now --- script/load-sample-data | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'script/load-sample-data') diff --git a/script/load-sample-data b/script/load-sample-data index f9e9d0f8a..e91516886 100755 --- a/script/load-sample-data +++ b/script/load-sample-data @@ -18,11 +18,11 @@ end # HACK: Normally to load fixtures you'd run `rake db:fixtures:load` but since we # have .csv files in the fixtures folder Rails tries to load those too. Therefore # we've pinched some code to load the fixtures: -# https://github.com/rails/rails/blob/5ecd14c5f16533d09c01007bf5d70f70a59c30e3/activerecord/lib/active_record/railties/databases.rake#L319 +# https://github.com/rails/rails/blob/v3.1.11/activerecord/lib/active_record/railties/databases.rake#L311 fixtures_dir = "#{ENV['LOC']}/../spec/fixtures" Dir["#{fixtures_dir}/**/*.yml"].each do |fixture_file| - Fixtures.create_fixtures(fixtures_dir, fixture_file[(fixtures_dir.size + 1)..-5]) + ActiveRecord::Fixtures.create_fixtures(fixtures_dir, fixture_file[(fixtures_dir.size + 1)..-5]) end load_raw_emails_data -- cgit v1.2.3