diff options
Diffstat (limited to 'railties/lib/generator/generators/app.rb')
-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 '.' |