Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong number of arguments (2 for 1) #1

Closed
greyblake opened this issue Aug 5, 2012 · 1 comment
Closed

wrong number of arguments (2 for 1) #1

greyblake opened this issue Aug 5, 2012 · 1 comment

Comments

@greyblake
Copy link

I can't migrate database.
Using version 0.0.2.

Backtrace:

lib/active_record/connection_adapters/mysql2_adapter.rb:381:in `tables'
lib/active_record/connection_adapters/mysql2_adapter.rb:400:in `table_exists?

From source code:

      def tables(name = nil)
        tables = []
        execute("SHOW TABLES", name).each do |field|
          tables << field.first
        end
        tables
      end

      def table_exists?(name)
        return true if super

        name = name.to_s
        schema, table = name.split('.', 2)

        unless table # A table was provided without a schema
          table = schema
          schema = nil
        end

        tables(nil, schema).include? table
      end

As you see #table_exists? calls #tables with 2 parameters.

@kronn
Copy link
Owner

kronn commented Aug 5, 2012

Thanks for the hint.

I ported the changes from the mysql2-gem (which should solve this) into this extract.

Version 0.0.3 (which has the upstream fixes) is pushed to rubygems and should be good for you.

@kronn kronn closed this as completed Aug 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants