Sha256: 295bb3d7de5012d5a7c6d834fdaf4f8a967a8dffe3d943d422c02f6cd531f039
Contents?: true
Size: 884 Bytes
Versions: 23
Compression:
Stored size: 884 Bytes
Contents
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
23 entries across 23 versions & 1 rubygems