Permalink
Browse files

Deprecate config.generators in Rails::Engine in favor of config.app_g…

…enerators.

config.generators still works fine in Rails::Application and Rails::Railtie, but it will be deprecated in the latter in Rails 3.1.
  • Loading branch information...
1 parent f283812 commit fef42738d735f4b76c7826576aeddad153e67eaf @josevalim josevalim committed Oct 2, 2010
@@ -14,6 +14,8 @@ class Configuration < ::Rails::Engine::Configuration
:secret_token, :serve_static_assets, :session_options,
:time_zone, :whiny_nils
+ alias :generators :app_generators
+
def initialize(*)
super
self.encoding = "utf-8"
@@ -33,6 +33,12 @@ def paths
end
end
+ def generators #:nodoc:
+ ActiveSupport::Deprecation.warn "config.generators in Rails::Engine is deprecated. " <<
+ "Please use config.app_generators instead."
+ super
+ end
+
def root=(value)
@root = paths.path = Pathname.new(value).expand_path
end
@@ -84,7 +84,7 @@ module Rails
#
# class MyRailtie < Rails::Railtie
# # Customize the ORM
- # config.generators.orm :my_railtie_orm
+ # config.app_generators.orm :my_railtie_orm
#
# # Add a to_prepare block which is executed once in production
# # and before which request in development
@@ -18,24 +18,25 @@ def app_middleware
# Holds generators configuration:
#
- # config.generators do |g|
+ # config.app_generators do |g|
# g.orm :datamapper, :migration => true
# g.template_engine :haml
# g.test_framework :rspec
# end
#
# If you want to disable color in console, do:
#
- # config.generators.colorize_logging = false
+ # config.app_generators.colorize_logging = false
#
- def generators
+ def app_generators
@@generators ||= Rails::Configuration::Generators.new
if block_given?
yield @@generators
else
@@generators
end
end
+ alias :generators :app_generators
def before_configuration(&block)
ActiveSupport.on_load(:before_configuration, :yield => true, &block)

0 comments on commit fef4273

Please sign in to comment.