EmpaticoOrg / scenic-mysql_adapter

MySQL adapter for thoughtbot/scenic
MIT License
30 stars 15 forks source link

Doesn't work with Rails 7 #13

Open rmeritz opened 2 years ago

rmeritz commented 2 years ago
 NoMethodError: undefined method `match' for nil:NilClass                                                                                          
from /home/rebecca/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/activerecord-7.0.3/lib/active_record/connection_adapters/mysql/schema_statements
.rb:162:in `default_type'
module ActiveRecord
  module ConnectionAdapters
    class AbstractMysqlAdapter < AbstractAdapter
      def create_table_info(table_name) # :nodoc:
        info = exec_query("SHOW CREATE TABLE #{quote_table_name(table_name)}", "SCHEMA").first
        info["Create Table"] || info["Create View"]
      end
    end
  end
end
andrewmarkle commented 2 years ago

FYI but this is a bug in Rails 7.0.3. Not this adapter. See: https://github.com/rails/rails/issues/45062 It's since been fixed and is in the 7-0-stable branch. I assume that 7.0.4 will fix it once released!