Module Sequel::Plugins::Uuid
In: lib/sequel/plugins/uuid.rb

The uuid plugin creates hooks that automatically create a uuid for every instance.

Usage:

  # Uuid all model instances using +uuid+
  # (called before loading subclasses)
  Sequel::Model.plugin :uuid

  # Uuid Album instances, with custom column name
  Album.plugin :uuid, field: :my_uuid

Methods

configure  

Classes and Modules

Module Sequel::Plugins::Uuid::ClassMethods
Module Sequel::Plugins::Uuid::InstanceMethods

Public Class methods

Configure the plugin by setting the available options. Note that if this method is run more than once, previous settings are ignored, and it will just use the settings given or the default settings. Options:

:field :The field to hold the uuid (default: :uuid)
:force :Whether to overwrite an existing uuid (default: false)

[Source]

    # File lib/sequel/plugins/uuid.rb, line 24
24:       def self.configure(model, opts=OPTS)
25:         model.instance_exec do
26:           @uuid_field = opts[:field]||:uuid
27:           @uuid_overwrite = opts[:force]||false
28:         end
29:       end

[Validate]