Permalink
Browse files

Move load_generators from Rails::Application to Rails::Engine

  • Loading branch information...
1 parent 6ee4612 commit 60281af200180d752b8300bdad3c0a869d56347f Stefan Sprenger committed May 26, 2011
Showing with 12 additions and 12 deletions.
  1. +0 −12 railties/lib/rails/application.rb
  2. +12 −0 railties/lib/rails/engine.rb
@@ -105,14 +105,6 @@ def load_tasks(app=self)
self
end
- def load_generators(app=self)
- initialize_generators
- railties.all { |r| r.load_generators(app) }
- Rails::Generators.configure!(app.config.generators)
- super
- self
- end
-
def load_console(app=self)
initialize_console
railties.all { |r| r.load_console(app) }
@@ -195,10 +187,6 @@ def initialize_tasks
end
end
- def initialize_generators
- require "rails/generators"
- end
-
def initialize_console
require "pp"
require "rails/console/app"
@@ -330,6 +330,14 @@ class Engine < Railtie
autoload :Configuration, "rails/engine/configuration"
autoload :Railties, "rails/engine/railties"
+ def load_generators(app=self)
+ initialize_generators
+ railties.all { |r| r.load_generators(app) }
+ Rails::Generators.configure!(app.config.generators)
+ super
+ self
+ end
+
class << self
attr_accessor :called_from, :isolated
alias :isolated? :isolated
@@ -567,6 +575,10 @@ def load_seed
protected
+ def initialize_generators
+ require "rails/generators"
+ end
+
def routes?
defined?(@routes)
end

0 comments on commit 60281af

Please sign in to comment.