diff --git a/lib/attr_encrypted/adapters/active_record.rb b/lib/attr_encrypted/adapters/active_record.rb index 1be38ca1..fca9343e 100644 --- a/lib/attr_encrypted/adapters/active_record.rb +++ b/lib/attr_encrypted/adapters/active_record.rb @@ -136,6 +136,8 @@ def method_missing_with_attr_encrypted(method, *args, &block) end end - ActiveRecord::Base.extend AttrEncrypted - ActiveRecord::Base.extend AttrEncrypted::Adapters::ActiveRecord + ActiveSupport.on_load(:active_record) do + extend AttrEncrypted + extend AttrEncrypted::Adapters::ActiveRecord + end end