Module: PostgresExt::Postgis::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Quoting
- Defined in:
- lib/postgres_ext/postgis/active_record/connection_adapters/postgresql_adapter.rb
Instance Method Summary collapse
Instance Method Details
#quote(value, column = nil) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/postgres_ext/postgis/active_record/connection_adapters/postgresql_adapter.rb', line 68 def quote(value, column = nil) if column && (column.type == :geometry || column.type == :geography) ActiveRecord::ConnectionAdapters::PostgreSQLColumn.geometry_to_string(value) else super end end |
#type_cast(value, column, array_member = false) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/postgres_ext/postgis/active_record/connection_adapters/postgresql_adapter.rb', line 76 def type_cast(value, column, array_member = false) return super unless column case value when RGeo::Feature::Instance return super unless /geometry|geography/ =~ column.sql_type ActiveRecord::ConnectionAdapters::PostgreSQLColumn.geometry_to_string(value) else super end end |