rails/rails — pull request #8475 by ndbroadbent (2012-12-10 12:00:06+00:00)
Title: Raise an exception during development if an asset is missing from `config.assets.precompile`

This ensures that developers won't forget to add assets to `config.assets.precompile` while they are developing. It's currently possible to have a site that works fine in development, but raises `AssetNotPrecompiledError` in production because an asset hasn't been compiled. This has happened to me a few times. I think it would be much better if an exception could be raised when an included asset doesn't match a filter in `config.assets.precompile`. I have added a `config.assets.enforce_precompile` option that enables this behavior for `javascript_include_tag` and `stylesheet_link_tag`.

In order for this to work, `config.assets.precompile` has to be defined in `config/application.rb`, since it needs to be shared across development and production.

This pull request is a proof of concept, but please let me know if you think it's a good idea. Thanks!