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

Issue with helper add_uuid_column in migrations #11

Closed
JavierOrtiz opened this issue Feb 6, 2023 · 1 comment
Closed

Issue with helper add_uuid_column in migrations #11

JavierOrtiz opened this issue Feb 6, 2023 · 1 comment

Comments

@JavierOrtiz
Copy link

JavierOrtiz commented Feb 6, 2023

Ruby version 2.7 deprecates automatic conversion from a hash to keyword arguments.

add_column method only accepts 3 arguments and extra options, when we call add_uiid_column we are sending 4 obtaining this error wrong number of arguments (given 4, expected 3)

Reviewing this code, we are sending the extra options as a {} which is treated as an argument:

add_column table_name, column_name, COLUMN_TYPE, COLUMN_OPTIONS.merge(opts)

In my code to solve the issue I need to use manually the default add_column method:

 add_column :table_name, :uuid, :binary, limit: 36, null: false

Code to solve it ** :

add_column table_name, column_name, COLUMN_TYPE, **COLUMN_OPTIONS.merge(opts)

I cant create a PR fixing this issue.

@gsmetal
Copy link
Member

gsmetal commented Feb 27, 2024

Fixed in #8

@gsmetal gsmetal closed this as completed Feb 27, 2024
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