Sha256: 132a79085c9ab62874c91f82a037eff8e90fd0a2bd056456336368bfd6037ead
Contents?: true
Size: 469 Bytes
Versions: 21
Compression:
Stored size: 469 Bytes
Contents
require 'securerandom' module CassandraObject module Identity extend ActiveSupport::Concern included do class_attribute :key_generator key do SecureRandom.uuid.tr('-','') end end module ClassMethods # Define a key generator. Default is UUID. def key(&block) self.key_generator = block end def _generate_key(object) object.instance_eval(&key_generator) end end end end
Version data entries
21 entries across 21 versions & 1 rubygems