Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hstores can be typecast
  • Loading branch information
tenderlove committed Feb 7, 2012
1 parent a92af3f commit 9821175
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -124,6 +124,14 @@ def type_cast(value)
end
end

class Hstore
def type_cast(value)
return if value.nil?

ConnectionAdapters::PostgreSQLColumn.cast_hstore value
end
end

class TypeMap
def initialize
@mapping = {}
Expand Down Expand Up @@ -198,6 +206,8 @@ def fetch(ftype, fmod)
TYPE_MAP[603] = OID::Vector.new(';', TYPE_MAP[600]) # box
TYPE_MAP[604] = OID::Identity.new # polygon
TYPE_MAP[718] = OID::Identity.new # circle

TYPE_MAP[1399854] = OID::Hstore.new # hstore
end
end
end
Expand Down

0 comments on commit 9821175

Please sign in to comment.