ignore extra args when test env
This commit is contained in:
parent
1f862baccf
commit
dcbf52a88b
|
|
@ -17,11 +17,14 @@ namespace :db do
|
|||
|
||||
desc "Migrate the database"
|
||||
task :migrate do
|
||||
version = ARGV[1]
|
||||
if !version.nil?
|
||||
version = version.to_i
|
||||
version = nil
|
||||
if ENV['RAILS_ENV'] != "test"
|
||||
version = ARGV[1]
|
||||
if !version.nil?
|
||||
version = version.to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
ActiveRecord::Base.establish_connection(db_config)
|
||||
migrate_dir = JamRuby::RakeUtil.migrations_path
|
||||
ActiveRecord::Migrator.migrate(migrate_dir, version)
|
||||
|
|
|
|||
Loading…
Reference in New Issue