gitlabhq/gitlabhq — pull request #3052 by Andrew8xx8 (2013-02-20 11:42:10+00:00)
Title: System hooks code & logic refactoring

We must stop to place logic in observers. It's not scalable, clean and also this code is hard to testing.

Let's go to include Service Layer.

Good resources about Service Layer:

http://collectiveidea.com/blog/archives/2012/06/28/wheres-your-business-logic/ http://blog.firsthand.ca/2011/10/rails-is-not-your-application.html http://blog.carbonfive.com/2012/01/10/does-my-rails-app-need-a-service-layer/