Module: Lite::Uxid::Record::Ulid

Defined in:
lib/lite/uxid/record/ulid.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
11
12
13
# File 'lib/lite/uxid/record/ulid.rb', line 8

def self.included(base)
  base.class_eval do
    before_create :callback_generate_uxid!,
                  if: proc { respond_to?(:uxid) && !uxid? }
  end
end

Instance Method Details

#uxid_prefixObject



15
16
17
18
# File 'lib/lite/uxid/record/ulid.rb', line 15

def uxid_prefix
  # Define in your class to enable prefixing uxid.
  # eg: "sub_" or "user_"
end