diff options
-rw-r--r-- | railties/lib/rails/generators.rb | 8 | ||||
-rw-r--r-- | railties/test/generators_test.rb | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index f24dc620de..3c902ce0d4 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -10,10 +10,16 @@ require 'active_support/core_ext/module/attribute_accessors' require 'active_support/core_ext/string/inflections' require 'rails/generators/base' -require 'rails/generators/named_base' module Rails module Generators + autoload :Actions, 'rails/generators/actions' + autoload :ActiveModel, 'rails/generators/active_model' + autoload :Migration, 'rails/generators/migration' + autoload :NamedBase, 'rails/generators/named_base' + autoload :ResourceHelpers, 'rails/generators/resource_helpers' + autoload :TestCase, 'rails/generators/test_case' + DEFAULT_ALIASES = { :rails => { :actions => '-a', diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 07bc92c55c..dd17f8f756 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -145,17 +145,17 @@ class GeneratorsTest < Rails::Generators::TestCase end def test_developer_options_are_overwriten_by_user_options - Rails::Generators.options[:new_generator] = { :generate => false } + Rails::Generators.options[:with_options] = { :generate => false } self.class.class_eval <<-end_eval - class NewGenerator < Rails::Generators::Base + class WithOptionsGenerator < Rails::Generators::Base class_option :generate, :default => true end end_eval - assert_equal false, NewGenerator.class_options[:generate].default + assert_equal false, WithOptionsGenerator.class_options[:generate].default ensure - Rails::Generators.subclasses.delete(NewGenerator) + Rails::Generators.subclasses.delete(WithOptionsGenerator) end def test_load_generators_from_railties |