Open canavese opened 12 years ago
This is because of the ActiveRecord commit here: https://github.com/rails/rails/commit/5766539342426e956980bf6f54ef99600cbfc33e#activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
I've created a fork to fix this here: https://github.com/descentintomael/spatial_adapter
I'm still working on figuring out the :option => "ENGINE=MyISAM" thing though. For whatever reason InnoDB isn't liking the spatial extensions.
Solution! I really should have waited on that previous comment:
In your migration for creating the table you want spatial extensions on replace
create_table :my_table_name do |t|
with
create_table(:my_table_name, :options => 'ENGINE=MyISAM') do |t|
descentintomael, can you submit your pull request to the fagility/spatial_adapter repo? It would be great to have this fix in the main repo as you previously submitted a pull request to a random forked repo instead. Thanks!
Done. Thanks for reminding me.
I dont really get it. Is it fixed right now with InnoDB too?
Unfortunately, it appears that the newest versions of ActiveRecord (3.2.0.rc1, at least) use: ActiveRecord::ConnectionAdapters::Mysql2Adapter::Column
gems/spatial_adapter-1.2.0/lib/spatial_adapter/mysql2.rb:83:in
<module:ConnectionAdapters>': uninitialized constant ActiveRecord::ConnectionAdapters::Mysql2Column (NameError) from gems/spatial_adapter-1.2.0/lib/spatial_adapter/mysql2.rb:82:in
module:ActiveRecord' from gems/spatial_adapter-1.2.0/lib/spatial_adapter/mysql2.rb:81:in<top (required)>' from gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in
require'