Skip to content

Commit

Permalink
Filter decrypted attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjackson committed Aug 21, 2019
1 parent f700026 commit c3d68bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/attr_encrypted/adapters/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ def assign_attributes(*args)
def attributes=(*args)
perform_attribute_assignment :attributes_without_attr_encrypted=, *args
end

alias_method :attributes_without_attr_encrypted, :attributes
def attributes
encrypted_keys = self.class.encrypted_attributes.keys
attributes_without_attr_encrypted.reject { |k, _| encrypted_keys.include?(k.to_sym) }
end
end
end

Expand Down

0 comments on commit c3d68bd

Please sign in to comment.