dazuma/activerecord-spatialite-adapter — Issue #1: insert fails on nil geometry values
Author: michael-groble
Created: 2012-02-14 21:56:59+00:00
State: open

Attempting to insert a new record with a nil geometry value, I get the error

undefined method `srid' for nil:NilClass

from ActiveRecord::ConnectionAdapters::SpatiaLiteAdapter::MainAdapter.exec_query

/Users/mike/.rvm/gems/ruby-1.9.3-p0@global/gems/activesupport-3.1.3/lib/active_support/whiny_nil.rb:48:in `method_missing'
/Users/mike/.rvm/gems/ruby-1.9.3-p0@rails3/gems/activerecord-spatialite-adapter-0.4.0/lib/active_record/connection_adapters/spatialite_adapter/main_adapter.rb:114:in `block in exec_query'
/Users/mike/.rvm/gems/ruby-1.9.3-p0@rails3/gems/activerecord-spatialite-adapter-0.4.0/lib/active_record/connection_adapters/spatialite_adapter/main_adapter.rb:111:in `each'
/Users/mike/.rvm/gems/ruby-1.9.3-p0@rails3/gems/activerecord-spatialite-adapter-0.4.0/lib/active_record/connection_adapters/spatialite_adapter/main_adapter.rb:111:in `exec_query'
/Users/mike/.rvm/gems/ruby-1.9.3-p0@rails3/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `exec_insert'
/Users/mike/.rvm/gems/ruby-1.9.3-p0@rails3/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'
/Users/mike/.rvm/gems/ruby-1.9.3-p0@rails3/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
...