Skip to content

Commit

Permalink
Always run load hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Oct 21, 2011
1 parent 2267be8 commit c976464
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/mongoid.rb
Expand Up @@ -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)

0 comments on commit c976464

Please sign in to comment.