Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Load ActiveRecord::Base forcibly when we want to use observers

  • Loading branch information...
commit 85a6511fad991dba33f3eb9d4b951b3756ec2a17 1 parent 38c9618
@kennyj authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 activerecord/lib/active_record/railtie.rb
View
5 activerecord/lib/active_record/railtie.rb
@@ -115,5 +115,10 @@ class Railtie < Rails::Railtie
end
end
end
+
+ config.after_initialize do
+ # If config.active_record.observers is not nil, we must load ActiveRecord::Base forcibly.
+ _ = ActiveRecord::Base if config.active_record.observers
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.