blob: bc93f6e1bfe28f41e9f613f07712c704c736a1bb (
plain) (
tree)
|
|
module ActiveRecord
module Type
class Binary < Value # :nodoc:
def type
:binary
end
def binary?
true
end
def type_cast_for_database(value)
Data.new(super)
end
class Data
def initialize(value)
@value = value
end
def to_s
@value
end
def hex
@value.unpack('H*')[0]
end
end
end
end
end
|