method

deserialize

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: Hstore
deserialize(value) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb, line 14
          def deserialize(value)
            if value.is_a?(::String)
              ::Hash[value.scan(HstorePair).map { |k, v|
                v = v.upcase == "NULL" ? nil : v.gsub(/\A"(.*)"\Z/, '\1').gsub(/\\(.)/, '\1')
                k = k.gsub(/\A"(.*)"\Z/, '\1').gsub(/\\(.)/, '\1')
                [k, v]
              }]
            else
              value
            end
          end
Register or log in to add new notes.