Sha256: df8f24065391ad24acc87ee95b26c439033bbc1bec4852c90123704ce9faa0d1
Contents?: true
Size: 351 Bytes
Versions: 55
Compression:
Stored size: 351 Bytes
Contents
module Agilibox::ActiveRecordUUIDConcern extend ActiveSupport::Concern private def assign_default_uuid unless self.class.columns_hash["id"].type == :uuid raise "invalid id type, please change to uuid" end self.id ||= ::Agilibox::SortableUUIDGenerator.call end included do before_save :assign_default_uuid end end
Version data entries
55 entries across 55 versions & 1 rubygems