diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-17 18:38:37 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-19 16:11:54 +0200 |
commit | 090de591fc9038e12a94aa109829919ccec3a0be (patch) | |
tree | 499c061d724084e318b5d789aaadb79b8d6eaea1 /railties/lib/generator/generators | |
parent | 6619357f75053db08f96ab0649312d1ba1126d2a (diff) | |
download | rails-090de591fc9038e12a94aa109829919ccec3a0be.tar.gz rails-090de591fc9038e12a94aa109829919ccec3a0be.tar.bz2 rails-090de591fc9038e12a94aa109829919ccec3a0be.zip |
Raise an error if invalid value for database is provided.
Diffstat (limited to 'railties/lib/generator/generators')
-rw-r--r-- | railties/lib/generator/generators/app.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/generator/generators/app.rb b/railties/lib/generator/generators/app.rb index c775d0da12..8b22437db6 100644 --- a/railties/lib/generator/generators/app.rb +++ b/railties/lib/generator/generators/app.rb @@ -45,6 +45,13 @@ module Rails::Generators class_option :help, :type => :boolean, :aliases => "-h", :group => :rails, :desc => "Show this help message and quit" + def initialize(*args) + super + if !options[:no_activerecord] && !DATABASES.include?(options[:database]) + raise Error, "Invalid value for --database option. Supported for preconfiguration are: #{DATABASES.join(", ")}." + end + end + def create_root self.root = File.expand_path(app_path, root) empty_directory '.' |