Sha256: 00c19656b87b0ae92c6f03a54c23b15e1ba872499ac7be8238b75c5555a6523f
Contents?: true
Size: 456 Bytes
Versions: 27
Compression:
Stored size: 456 Bytes
Contents
module CassandraObject module Identity extend ActiveSupport::Concern included do class_attribute :key_generator key do SimpleUUID::UUID.new.to_guid.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
27 entries across 27 versions & 2 rubygems