From c976464deeefcd5ab5f45cdb16789b32c2c029c5 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Fri, 21 Oct 2011 12:20:22 +0200 Subject: [PATCH] Always run load hooks --- lib/mongoid.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/mongoid.rb b/lib/mongoid.rb index ad5dfc5aaa..674f729ad9 100644 --- a/lib/mongoid.rb +++ b/lib/mongoid.rb @@ -147,8 +147,7 @@ def unit_of_work { :to => Config }) end -# After loading Mongoid, if Rails is defined we will get the load hooks cranked -# up here. This optimizes the number of calls to instantiate_observers. -if defined?(Rails) - ActiveSupport.run_load_hooks(:mongoid, Mongoid) -end +# After loading Mongoid, we will get the load hooks cranked +# up here. This optimizes the number of calls to instantiate_observers when in +# Rails. +ActiveSupport.run_load_hooks(:mongoid, Mongoid)