Switch from ActiveSupport's on_load to railtie initializer.

This resolves the insistent warning about errors in transactions, covered in #867.