errbit/errbit — pull request #165 by mathias (2012-03-07 22:20:50+00:00)
Title: Add Observers to Models

Hi guys!

This is a quick clean up to separate the concerns of mailing notifications from models. Here's an overview: [http://rails-bestpractices.com/posts/19-use-observer](http://rails-bestpractices.com/posts/19-use-observer)

I've refactored out the logic that decides whether to send an email for both Notices and Deploys into their own Observers. Luckily, Mongoid has observers that behave a lot like ActiveRecord, so it is rather simple code. The tests have been migrated accordingly to matching spec files.

Thanks!