Skip to content

Commit 5a83bc8

Browse files
committed
use to_prepare for Rails 2
1 parent cf8f80b commit 5a83bc8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/attr_encrypted/adapters/active_record.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ def method_missing_with_attr_encrypted(method, *args, &block)
133133
end
134134
end
135135

136-
ActiveSupport.on_load(:active_record) do
137-
extend AttrEncrypted
138-
extend AttrEncrypted::Adapters::ActiveRecord
136+
Rails.configuration.to_prepare do
137+
ActiveRecord::Base.class_eval do
138+
extend AttrEncrypted
139+
extend AttrEncrypted::Adapters::ActiveRecord
140+
end
139141
end
140142
end

0 commit comments

Comments
 (0)