Sha256: f2188bf2592a9f4e5d0aceb9f4af587854720d0b9d8a24b963c8b0e9f07cf52f
Contents?: true
Size: 543 Bytes
Versions: 16
Compression:
Stored size: 543 Bytes
Contents
# frozen_string_literal: true module ActiveRecord module ConnectionAdapters module PostgreSQL module OID # :nodoc: class Uuid < Type::Value # :nodoc: ACCEPTABLE_UUID = %r{\A(\{)?([a-fA-F0-9]{4}-?){8}(?(1)\}|)\z} alias_method :serialize, :deserialize def type :uuid end private def cast_value(value) casted = value.to_s casted if casted.match?(ACCEPTABLE_UUID) end end end end end end
Version data entries
16 entries across 16 versions & 4 rubygems