juno/mongoid-encryptor — Issue #3: Different implementation than Mongoid
Author: iamnader
Created: 2011-11-18 23:08:54+00:00
State: open

In the latest Mongoid read_attribute for validation looks like this:

def read_attribute_for_validation(attr)
if relations[attr.to_s]
begin_validate
relation = send(attr)
exit_validate
relation.do_or_do_not(:in_memory) || relation
else
send(attr)
end
end

Yours looks like this:

def read_attribute_for_validation(key)
v = read_attribute(key)
v.try(:encrypted?) ? v.decrypt : v
end

Seems like you're changing the behavior, not just decrypting, right?