Skip to content

Commit c3d68bd

Browse files
committed
Filter decrypted attributes
1 parent f700026 commit c3d68bd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/attr_encrypted/adapters/active_record.rb

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ def assign_attributes(*args)
4343
def attributes=(*args)
4444
perform_attribute_assignment :attributes_without_attr_encrypted=, *args
4545
end
46+
47+
alias_method :attributes_without_attr_encrypted, :attributes
48+
def attributes
49+
encrypted_keys = self.class.encrypted_attributes.keys
50+
attributes_without_attr_encrypted.reject { |k, _| encrypted_keys.include?(k.to_sym) }
51+
end
4652
end
4753
end
4854

0 commit comments

Comments
 (0)