Sha256: 7635d96772257443f809a61b1e88cbc69eedc5f3b480e35628e20bba577af1ca
Contents?: true
Size: 915 Bytes
Versions: 6
Compression:
Stored size: 915 Bytes
Contents
# frozen_string_literal: true module Arel # :nodoc: module Visitors # :nodoc: # Different super-class under JRuby JDBC adapter. PostGISSuperclass = if defined?(::ArJdbc::PostgreSQL::BindSubstitution) ::ArJdbc::PostgreSQL::BindSubstitution else PostgreSQL end class PostGIS < PostGISSuperclass # :nodoc: include RGeo::ActiveRecord::SpatialToSql FUNC_MAP = { "st_wkttosql" => "ST_GeomFromEWKT", } def st_func(standard_name) FUNC_MAP[standard_name.downcase] || standard_name end def visit_String(node, collector) collector << "#{st_func('ST_WKTToSQL')}(#{quote(node)})" end def visit_RGeo_ActiveRecord_SpatialNamedFunction(node, collector) aggregate(st_func(node.name), node, collector) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems