Skip to content

Commit

Permalink
use to_prepare for Rails 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nightpool committed Jul 22, 2022
1 parent cf8f80b commit 5a83bc8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/attr_encrypted/adapters/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5a83bc8

Please sign in to comment.