Skip to content

Instantly share code, notes, and snippets.

@stevebartholomew
Created January 4, 2011 12:38
Show Gist options
  • Save stevebartholomew/764726 to your computer and use it in GitHub Desktop.
Save stevebartholomew/764726 to your computer and use it in GitHub Desktop.
Override Rails's test prepare db task to source in postgis data
namespace :db do
namespace :test do
task :prepare_postgis do
`/usr/local/pgsql/bin/psql dbname -f /usr/local/pgsql-9.0/share/contrib/postgis-1.5/postgis.sql -U postgres`
`/usr/local/pgsql/bin/psql dbname -f /usr/local/pgsql-9.0/share/contrib/postgis-1.5/spatial_ref_sys.sql -U postgres`
end
end
end
Rake::Task["db:test:prepare"].enhance do
Rake::Task["db:test:prepare_postgis"].invoke
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment