aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/command
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-02-18 22:14:48 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2017-02-18 22:14:48 +0100
commite51572dce00c5f011f019397984ed8e82d94fc84 (patch)
tree4c15aecffda8985af72975a316eb813711890bca /railties/lib/rails/command
parent74689fda0ce7612d87c620a36097d2d7451f53c0 (diff)
downloadrails-e51572dce00c5f011f019397984ed8e82d94fc84.tar.gz
rails-e51572dce00c5f011f019397984ed8e82d94fc84.tar.bz2
rails-e51572dce00c5f011f019397984ed8e82d94fc84.zip
Share the common implementation between apps and engines.
Diffstat (limited to 'railties/lib/rails/command')
-rw-r--r--railties/lib/rails/command/actions.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/railties/lib/rails/command/actions.rb b/railties/lib/rails/command/actions.rb
index fb80e9d997..8fda1c87c6 100644
--- a/railties/lib/rails/command/actions.rb
+++ b/railties/lib/rails/command/actions.rb
@@ -8,16 +8,16 @@ module Rails
Dir.chdir(File.expand_path("../../", APP_PATH)) unless File.exist?(File.expand_path("config.ru"))
end
- if defined?(ENGINE_PATH)
- def require_application_and_environment!
- require ENGINE_PATH
+ def require_application_and_environment!
+ require ENGINE_PATH if defined?(ENGINE_PATH)
- if defined?(APP_PATH)
- require APP_PATH
- Rails.application.require_environment!
- end
+ if defined?(APP_PATH)
+ require APP_PATH
+ Rails.application.require_environment!
end
+ end
+ if defined?(ENGINE_PATH)
def load_tasks
Rake.application.init("rails")
Rake.application.load_rakefile
@@ -29,11 +29,6 @@ module Rails
engine.load_generators
end
else
- def require_application_and_environment!
- require APP_PATH
- Rails.application.require_environment!
- end
-
def load_tasks
Rails.application.load_tasks
end