Sha256: 65ab822eddab5803e4b8d60e8af02f0a834d46a4091bc8116f5883a2b58d9e0c

Contents?: true

Size: 335 Bytes

Versions: 4

Compression:

Stored size: 335 Bytes

Contents

module Webhooks::Outgoing::HasUuid
  extend ActiveSupport::Concern

  # define relationships.
  included do
    after_initialize do
      self.uuid ||= SecureRandom.hex
    end
  end

  # define class methods.
  module ClassMethods
  end

  # define object methods.
  def short_uuid
    self.uuid.first(7)
  rescue
    "nil"
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
bullet_train-outgoing_webhooks-core-1.0.3 app/models/concerns/webhooks/outgoing/has_uuid.rb
bullet_train-outgoing_webhooks-core-1.0.2 app/models/concerns/webhooks/outgoing/has_uuid.rb
bullet_train-outgoing_webhooks-1.0.1 lib/models/concerns/webhooks/outgoing/has_uuid.rb
bullet_train-outgoing_webhooks-1.0.0 lib/models/concerns/webhooks/outgoing/has_uuid.rb