aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib
diff options
context:
space:
mode:
authorFumiaki MATSUSHIMA <mtsmfm@gmail.com>2016-12-22 19:21:11 +0900
committerFumiaki MATSUSHIMA <mtsmfm@gmail.com>2017-01-03 21:18:09 +0900
commit085546df456139b6c5d2cde964133e93a0818571 (patch)
tree1cf387116f32d69653126dd9e7c63bb10f197414 /activejob/lib
parent33e60514aed85b3076f2636d5f1ccfb513aace1c (diff)
downloadrails-085546df456139b6c5d2cde964133e93a0818571.tar.gz
rails-085546df456139b6c5d2cde964133e93a0818571.tar.bz2
rails-085546df456139b6c5d2cde964133e93a0818571.zip
Fix generator command for nested (namespaced) rails engine
If we create nested (namespaced) rails engine such like bukkits-admin, `bin/rails g scaffold User name:string age:integer` will create `bukkits-admin/app/controllers/bukkits/users_controller.rb` but it should create `bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`. In #6643, we changed `namespaced_path` as root path because we supposed application_controller is always in root but nested rails engine's application_controller will not.
Diffstat (limited to 'activejob/lib')
-rw-r--r--activejob/lib/rails/generators/job/job_generator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activejob/lib/rails/generators/job/job_generator.rb b/activejob/lib/rails/generators/job/job_generator.rb
index 97c11a9ea6..7cef42bc83 100644
--- a/activejob/lib/rails/generators/job/job_generator.rb
+++ b/activejob/lib/rails/generators/job/job_generator.rb
@@ -28,7 +28,7 @@ module Rails # :nodoc:
private
def application_job_file_name
@application_job_file_name ||= if mountable_engine?
- "app/jobs/#{namespaced_path}/application_job.rb"
+ File.join("app/jobs", namespaced_path, "application_job.rb")
else
"app/jobs/application_job.rb"
end