Using an observer within an Engine
I've created an Engine which is basically used for all of our projects. Now what I want to do is add a before_create callback to all of the models in this Engine. After some searching I found out that an observer is the way to go. So, I've created this observer: # app/models/baco/auth/auth_observer class Baco::Auth::AuthObserver < ActiveRecord::Observer def before_create( record ) p record end end And now I need to add it to the application, but of course in my Engine there is no such file as application.rb, so I've placed it in my engine: # lib/baco/auth/engine.rb require 'rails' require