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)