FarmBot/OpenFarm — pull request #176 by rickcarlino (2014-09-16 00:56:57+00:00)
Title: Fix production exceptions / Move Excessive controller logic into interactions (via mutations gem)

# Why?

I caught a bug on production the other day that (like a few other exceptions caught recently) was caused by `nil` objects or improperly formatted strings. The quickfix that I deployed to keep the site running worked, but was starting to put too much logic in the controller.

For a more long term solution to these issues, I added the [Mutations Gem](https://github.com/cypriss/mutations). This is a win in the long run because it:

* Tells API consumers **why** their response was not processed
* Prevents exceptions from ever happening by explicitly stating validation of input parameters (so they never get to the controller if invalid)
* Keeps controllers skinny, the way nature intended.

# What's Next?

The last seven days saw a lot of set backs as a result of exceptions on production and a low level of test coverage. Tomorrow I will write some more specs to get our coverage over the 90% mark. After that I need to:

* Merge @digital-dreamer 's Rack::Attack gem (sorry I'm taking so long- we appreciate all of your contributions)
* Setup staging server
* Install HTTPS cert on production
* Finish the photo attachment stuff on guides
* Patch any TODO items that come up when I run `rake notes`