From 02ef8d20a19f9548800eaefc0ebdf18fbd9a67be Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Thu, 4 Feb 2010 10:59:24 +1100 Subject: Adding guard to make sure test database declarations exist before trying to auto create --- activerecord/lib/active_record/railties/databases.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 4343bef3d4..ed7d2a045e 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -28,8 +28,8 @@ namespace :db do desc 'Create the database defined in config/database.yml for the current Rails.env - also makes test database if in development mode' task :create => :load_config do - # Make the test database at the same time as the development one - if Rails.env == 'development' + # Make the test database at the same time as the development one, if it exists + if Rails.env.development? && ActiveRecord::Base.configurations['test'] create_database(ActiveRecord::Base.configurations['test']) end create_database(ActiveRecord::Base.configurations[Rails.env]) -- cgit v1.2.3 From 1ae543a180095efef5ad59eb9883748ca20cebcf Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Thu, 4 Feb 2010 11:08:46 +1100 Subject: -v and --version params now work on rails script in or our of an app --- railties/lib/rails/commands.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb index f0dcf61d98..4240038673 100644 --- a/railties/lib/rails/commands.rb +++ b/railties/lib/rails/commands.rb @@ -59,6 +59,9 @@ when 'runner' require 'rails/commands/runner' require ENV_PATH + +when '--version', '-v' + puts "Rails #{Rails::VERSION::STRING}" when '--help', '-h' puts HELP_TEXT when '--version', '-v' -- cgit v1.2.3