This repository has been archived by the owner. It is now read-only.
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (17 sloc) 330 Bytes
require 'dm-core'
module DataMapper
class Property
class Regexp < String
load_as ::Regexp
def load(value)
::Regexp.new(value) unless value.nil?
end
def dump(value)
value.source unless value.nil?
end
def typecast(value)
load(value)
end
end
end
end