aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/engine.rb
diff options
context:
space:
mode:
authorStefan Sprenger <stefan.sprenger@dkd.de>2011-05-26 17:57:46 +0200
committerStefan Sprenger <stefan.sprenger@dkd.de>2011-05-26 17:57:46 +0200
commit60281af200180d752b8300bdad3c0a869d56347f (patch)
treef41ba9278bd85e941b0d2fb809ce2197a281da1b /railties/lib/rails/engine.rb
parent6ee461237a04122559bf9871df602eec4079cd08 (diff)
downloadrails-60281af200180d752b8300bdad3c0a869d56347f.tar.gz
rails-60281af200180d752b8300bdad3c0a869d56347f.tar.bz2
rails-60281af200180d752b8300bdad3c0a869d56347f.zip
Move load_generators from Rails::Application to Rails::Engine
Diffstat (limited to 'railties/lib/rails/engine.rb')
-rw-r--r--railties/lib/rails/engine.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index 383be1802f..b358de89d0 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -330,6 +330,14 @@ module Rails
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 @@ module Rails
protected
+ def initialize_generators
+ require "rails/generators"
+ end
+
def routes?
defined?(@routes)
end