diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-21 21:47:06 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-21 21:47:06 -0300 |
commit | 62bcf81431baf84f7e4c370c1ae30fe07ee1022a (patch) | |
tree | 8aea31bbe496116240944654ed4465d12bd6d381 /activerecord/lib/active_record/connection_adapters/postgresql/oid/vector.rb | |
parent | b754d9b56d437933c1a0bcc333f8b55efd87af57 (diff) | |
parent | 30bf07d172f2764b27e887ff3a122ce3c08ff5fe (diff) | |
download | rails-62bcf81431baf84f7e4c370c1ae30fe07ee1022a.tar.gz rails-62bcf81431baf84f7e4c370c1ae30fe07ee1022a.tar.bz2 rails-62bcf81431baf84f7e4c370c1ae30fe07ee1022a.zip |
Merge pull request #15218 from sgrif/sg-move-oid-types
Move PG OID types to their own files
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid/vector.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid/vector.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/vector.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/vector.rb new file mode 100644 index 0000000000..2f7d1be197 --- /dev/null +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/vector.rb @@ -0,0 +1,26 @@ +module ActiveRecord + module ConnectionAdapters + module PostgreSQL + module OID # :nodoc: + class Vector < Type::Value + attr_reader :delim, :subtype + + # +delim+ corresponds to the `typdelim` column in the pg_types + # table. +subtype+ is derived from the `typelem` column in the + # pg_types table. + def initialize(delim, subtype) + @delim = delim + @subtype = subtype + end + + # FIXME: this should probably split on +delim+ and use +subtype+ + # to cast the values. Unfortunately, the current Rails behavior + # is to just return the string. + def type_cast(value) + value + end + end + end + end + end +end |