Sha256: 0c66fd5cf11065678fffd3598d763c709833ac7df2d3de46ecb0f314e1dffc93
Contents?: true
Size: 339 Bytes
Versions: 19
Compression:
Stored size: 339 Bytes
Contents
module BMC::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 ||= BMC::SortableUUIDGenerator.call end included do before_save :assign_default_uuid end end
Version data entries
19 entries across 19 versions & 1 rubygems