diff --git a/lib/symmetric_encryption.rb b/lib/symmetric_encryption.rb
index <HASH>..<HASH> 100644
--- a/lib/symmetric_encryption.rb
+++ b/lib/symmetric_encryption.rb
@@ -7,18 +7,14 @@ begin
 rescue LoadError
 end
 
-begin
-  require 'active_record'
+ActiveSupport.on_load(:active_record) do
   require 'symmetric_encryption/railties/attr_encrypted'
   require 'symmetric_encryption/railties/symmetric_encryption_validator'
 
   ActiveRecord::Base.include(SymmetricEncryption::Railties::AttrEncrypted)
-rescue LoadError
 end
 
-begin
-  require 'mongoid'
+ActiveSupport.on_load(:mongoid) do
   require 'symmetric_encryption/railties/mongoid_encrypted'
   require 'symmetric_encryption/railties/symmetric_encryption_validator'
-rescue LoadError
 end
Lazily loads ORM adapters to mitigate #<I>