comfy/comfortable-mexican-sofa — pull request #276 by marcgg (2013-03-15 11:59:12+00:00)
Title: Added config.enable_catch_all

Hi,

I added a feature to deactivate the catch-all (described here https://github.com/comfy/comfortable-mexican-sofa/wiki/How-to-protect-other-engines-from-catch-all-route) by doing

``` ruby
config.enable_catch_all = false
````

in the initializer.

I need this because I'm using cms for only a subset of my site: I have a fixed number of pages and I will never link them dynamically, so I don't need the catch-all.

If it stays activated, I get an overhead every time someone 404s because it will first check the database to see if a CMS page exists. This seems minor, but when bots crawl the site randomly or when an asset is missing on all pages this makes for a lot of useless call.

Disabling the catch-all for good would fix this. This is perfectly retrocompatible as it defaults to "true" and keeps the same logic as before.

Let me know what you think

Cheers