Initial commit

This commit is contained in:
Yaser
2026-08-13 19:50:53 +03:30
commit 38084458fe
879 changed files with 95198 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# encoding: UTF-8
# frozen_string_literal: true
module TIDIdentifiable
extend ActiveSupport::Concern
included do
validates :tid, presence: true, uniqueness: { case_sensitive: false }
before_validation do
next unless tid.blank?
begin
self.tid = "TID#{SecureRandom.hex(5).upcase}"
end while self.class.where(tid: tid).any?
end
end
end