Skip to content
This repository was archived by the owner on Feb 2, 2018. It is now read-only.
This repository was archived by the owner on Feb 2, 2018. It is now read-only.

Different implementation than Mongoid #3

Description

@iamnader

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions