diff --git a/lib/attr_encrypted/adapters/active_record.rb b/lib/attr_encrypted/adapters/active_record.rb index f3d2532f..9bcff05b 100644 --- a/lib/attr_encrypted/adapters/active_record.rb +++ b/lib/attr_encrypted/adapters/active_record.rb @@ -133,8 +133,10 @@ def method_missing_with_attr_encrypted(method, *args, &block) end end - ActiveSupport.on_load(:active_record) do - extend AttrEncrypted - extend AttrEncrypted::Adapters::ActiveRecord + Rails.configuration.to_prepare do + ActiveRecord::Base.class_eval do + extend AttrEncrypted + extend AttrEncrypted::Adapters::ActiveRecord + end end end