Permalink
Browse files

Add app/models/concerns and app/controllers/concerns to the default d…

…irectory structure and load path
  • Loading branch information...
dhh committed Dec 18, 2012
1 parent dcb318e commit f6bbc3f582bfc16da3acc152c702b04102fcab81
View
@@ -1,5 +1,9 @@
## Rails 4.0.0 (unreleased) ##
* 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 `public/index.html` is no longer generated for new projects.
Page is replaced by internal `welcome_controller` inside of railties.
@@ -38,26 +38,35 @@ def generators #:nodoc:
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
paths.add "app/helpers", eager_load: true
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
@@ -55,8 +55,12 @@ def gitignore
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

8 comments on commit f6bbc3f

@kenn

This comment has been minimized.

Show comment
Hide comment
@kenn

kenn Dec 19, 2012

Contributor

👍 I've been having app/models/traits to put together ActiveSupport::Concern mixins and now it's official. Great stuff!

Contributor

kenn replied Dec 19, 2012

👍 I've been having app/models/traits to put together ActiveSupport::Concern mixins and now it's official. Great stuff!

@TimothyKlim

This comment has been minimized.

Show comment
Hide comment
@TimothyKlim

TimothyKlim replied Dec 23, 2012

👍

@naveed-ahmad

This comment has been minimized.

Show comment
Hide comment
@naveed-ahmad

naveed-ahmad replied Jan 9, 2013

Nice 👍

@Mik-die

This comment has been minimized.

Show comment
Hide comment
@Mik-die

Mik-die Jan 12, 2013

Contributor

How do you think, app/models/concerns will be appropriate for storing association extension modules and custom validation classes? Same question for filter class for controllers.

Contributor

Mik-die replied Jan 12, 2013

How do you think, app/models/concerns will be appropriate for storing association extension modules and custom validation classes? Same question for filter class for controllers.

@boostbob

This comment has been minimized.

Show comment
Hide comment
@boostbob

boostbob May 15, 2013

nice places to hold Fooable.

boostbob replied May 15, 2013

nice places to hold Fooable.

@hulkfoo

This comment has been minimized.

Show comment
Hide comment
@hulkfoo

hulkfoo Sep 22, 2013

slice up chubby models👍

hulkfoo replied Sep 22, 2013

slice up chubby models👍

@awais545

This comment has been minimized.

Show comment
Hide comment
@awais545

awais545 replied Feb 27, 2014

👍

@khanhpham1990

This comment has been minimized.

Show comment
Hide comment
@khanhpham1990

khanhpham1990 replied Nov 12, 2015

Cool (y)

Please sign in to comment.