diff options
-rw-r--r-- | railties/CHANGELOG.md | 6 | ||||
-rw-r--r-- | railties/lib/rails/engine/configuration.rb | 9 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 4 |
3 files changed, 19 insertions, 0 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 126a38a2d6..a32f33140b 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,8 +1,14 @@ ## Rails 4.0.0 (unreleased) ## +<<<<<<< HEAD +* Add app/models/concerns and app/controllers/concerns to the default directory structure and load path *DHH* + + See http://37signals.com/svn/posts/3372-put-chubby-models-on-a-diet-with-concerns for usage instructions. +======= * The `rails/info/routes` now correctly formats routing output as an html table. *Richard Schneeman* +>>>>>>> f6d0eda918756bf56e2c05afcaaabda723487017 * The `public/index.html` is no longer generated for new projects. Page is replaced by internal `welcome_controller` inside of railties. diff --git a/railties/lib/rails/engine/configuration.rb b/railties/lib/rails/engine/configuration.rb index 22e885a3a6..10d1821709 100644 --- a/railties/lib/rails/engine/configuration.rb +++ b/railties/lib/rails/engine/configuration.rb @@ -38,6 +38,7 @@ module Rails def paths @paths ||= begin paths = Rails::Paths::Root.new(@root) + paths.add "app", eager_load: true, glob: "*" paths.add "app/assets", glob: "*" paths.add "app/controllers", eager_load: true @@ -45,19 +46,27 @@ module Rails paths.add "app/models", eager_load: true paths.add "app/mailers", eager_load: true paths.add "app/views" + + paths.add "app/controllers/concerns", eager_load: true + paths.add "app/models/concerns", eager_load: true + paths.add "lib", load_path: true paths.add "lib/assets", glob: "*" paths.add "lib/tasks", glob: "**/*.rake" + paths.add "config" paths.add "config/environments", glob: "#{Rails.env}.rb" paths.add "config/initializers", glob: "**/*.rb" paths.add "config/locales", glob: "*.{rb,yml}" paths.add "config/routes.rb" + paths.add "db" paths.add "db/migrate" paths.add "db/seeds.rb" + paths.add "vendor", load_path: true paths.add "vendor/assets", glob: "*" + paths end end diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index c98f021cfe..372790df59 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -55,8 +55,12 @@ module Rails def app directory 'app' + keep_file 'app/mailers' keep_file 'app/models' + + keep_file 'app/controllers/concerns' + keep_file 'app/models/concerns' end def config |