rgeo / activerecord-mysql2spatial-adapter

ActiveRecord connection adapter for MySQL Spatial Extensions, based on mysql2 and rgeo
48 stars 64 forks source link

Support Ruby 2.4 #27

Open dschweisguth opened 7 years ago

dschweisguth commented 7 years ago

Under Ruby 2.4.1, four tests fail with e.g.

> bundle exec rake test
Loaded testcase test/tc_basic.rb
Loaded testcase test/tc_spatial_queries.rb
Run options: --seed 56062

# Running:

/Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:762: warning: constant ::Fixnum is deprecated
EE/Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:762: warning: constant ::Fixnum is deprecated
.....E....E.

Finished in 1.957929s, 7.1504 runs/s, 10.2149 assertions/s.

  1) Error:
RGeo::ActiveRecord::Mysql2SpatialAdapter::Tests::TestSpatialQueries#test_query_st_length:
TypeError: Cannot visit Integer
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/visitor.rb:28:in `rescue in visit'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/visitor.rb:22:in `visit'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:515:in `visit_Arel_Nodes_Equality'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/visitor.rb:22:in `visit'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:496:in `block in visit_Arel_Nodes_And'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:496:in `map'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:496:in `visit_Arel_Nodes_And'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/visitor.rb:22:in `visit'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:204:in `block in visit_Arel_Nodes_SelectCore'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:203:in `each'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:203:in `each_with_index'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:203:in `visit_Arel_Nodes_SelectCore'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/mysql.rb:41:in `visit_Arel_Nodes_SelectCore'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:163:in `block in visit_Arel_Nodes_SelectStatement'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:163:in `each'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/to_sql.rb:163:in `visit_Arel_Nodes_SelectStatement'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/mysql.rb:36:in `visit_Arel_Nodes_SelectStatement'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/visitor.rb:22:in `visit'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/visitor.rb:5:in `accept'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/arel-5.0.1.20140414130214/lib/arel/visitors/bind_visitor.rb:11:in `accept'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/connection_adapters/abstract/database_statements.rb:13:in `to_sql'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/connection_adapters/abstract/database_statements.rb:24:in `select_all'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/querying.rb:39:in `find_by_sql'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/relation.rb:611:in `exec_queries'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/relation.rb:493:in `load'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/relation.rb:238:in `to_a'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/relation/finder_methods.rb:474:in `find_nth_with_limit'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/relation/finder_methods.rb:468:in `find_nth'
    /Users/dave/.rbenv/versions/2.4.1/gemsets/activerecord-mysql2spatial-adapter/gems/activerecord-4.1.16/lib/active_record/relation/finder_methods.rb:132:in `first'
    test/tc_spatial_queries.rb:104:in `test_query_st_length'

Fixing that means using newer arel, which means using newer ActiveRecord. So this will have to wait for #12.

januszm commented 7 years ago

Support for Ruby 2.4 will come together with support for ActiveRecord 5.0+