Module: Voltron::Encryptable

Defined in:
lib/voltron/encryptable.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Instance Method Summary collapse

Instance Method Details

#encrypted_idObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/voltron/encryptable.rb', line 4

def encrypted_id
  extend ClassMethods
  include InstanceMethods

  has_one :encryptable, as: :resource, class_name: "Voltron::Id"

  before_create do
    self.build_encryptable id: find_id
  end
end