blob: 243ecd13cfeffde2c434d530b44c1c516055c80b (
plain) (
tree)
|
|
module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module OID # :nodoc:
class Bit < Type::Value # :nodoc:
def type
:bit
end
def type_cast(value)
if ::String === value
case value
when /^0x/i
value[2..-1].hex.to_s(2) # Hexadecimal notation
else
value # Bit-string notation
end
else
value
end
end
end
end
end
end
end
|