Sha256: aa89de2bcc1dc318e48cc4698fa8198ef06a19d8df46255002ff3696147ea183

Contents?: true

Size: 349 Bytes

Versions: 18

Compression:

Stored size: 349 Bytes

Contents

# frozen_string_literal: true

module ActiveUxid
  module Record
    module Ulid
      extend ActiveSupport::Concern

      included do
        before_create :callback_generate_uxid!, if: proc { respond_to?(:uxid) }
      end

      private

      def callback_generate_uxid!
        self.uxid = ActiveUxid::Ulid.encode
      end

    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
active_uxid-5.1.0 lib/active_uxid/record/ulid.rb
active_uxid-5.0.2 lib/active_uxid/record/ulid.rb
active_uxid-5.0.1 lib/active_uxid/record/ulid.rb
active_uxid-5.0.0 lib/active_uxid/record/ulid.rb
active_uxid-1.0.13 lib/active_uxid/record/ulid.rb
active_uxid-1.0.12 lib/active_uxid/record/ulid.rb
active_uxid-1.0.11 lib/active_uxid/record/ulid.rb
active_uxid-1.0.10 lib/active_uxid/record/ulid.rb
active_uxid-1.0.9 lib/active_uxid/record/ulid.rb
active_uxid-1.0.8 lib/active_uxid/record/ulid.rb
active_uxid-1.0.7 lib/active_uxid/record/ulid.rb
active_uxid-1.0.6 lib/active_uxid/record/ulid.rb
active_uxid-1.0.5 lib/active_uxid/record/ulid.rb
active_uxid-1.0.4 lib/active_uxid/record/ulid.rb
active_uxid-1.0.3 lib/active_uxid/record/ulid.rb
active_uxid-1.0.2 lib/active_uxid/record/ulid.rb
active_uxid-1.0.1 lib/active_uxid/record/ulid.rb
active_uxid-1.0.0 lib/active_uxid/record/ulid.rb