rails/rails — pull request #7587 by elia (2012-10-27 16:49:01+00:00)
Title: Should not eager_load app/assets

If I happen to use a `.rb` file inside `app/assets` it can get automatically loaded, this probably holds true for `app/views`.

I think this is not the intended behavior, [railties has](https://github.com/rails/rails/blob/master/railties/lib/rails/engine/configuration.rb#L38):

```ruby
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"
```

seems quite clear that the first line refers to all non-specified paths

Of course I can fix this per application by adding to `application.rb`:

```ruby
config.before_initialize do
config.eager_load_paths = config.eager_load_paths.dup - Dir["#{Rails.root}/app/{assets,views}"]
end
```