rails/rails — pull request #5911 by arturaz (2012-04-20 16:36:23+00:00)
Title: Do not allow editing middleware stack after it has been built.

This prevents stupid mistakes, like this:

```ruby
config.after_initialize do
# Whoops, doesn't do anything and will silently fail. Not quite good.
config.middleware.use ExceptionNotifier,
:email_prefix => "[N44 WEB ERROR] ",
:sender_address => %{"Rails Notifier" },
:exception_recipients => EXCEPTION_RECIPIENTS # this is defined in config/initializers/config.rb
# and cannot be accessed before initialization.
# So junior programmer moves it to #after_initialize
# and things go boom.
end
```