Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hstores can be typecast

  • Loading branch information...
commit 98211755bb8145d2622b46bff9246daa607dafe4 1 parent a92af3f
@tenderlove tenderlove authored
View
10 activerecord/lib/active_record/connection_adapters/postgresql/oid.rb
@@ -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 = {}
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.