-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
allow for arrays to be defined as symbol #13146
Conversation
`change_colum :table, :column, :bigint, array: true` didn't work because the array option tried to string concat: `:bigint << '[]'` I don't know if this is the right place to convert the possible symbol to a string. If it's wrong please let me know a better place and I will change this.
@jigfox if you look at the test a few lines below it seems that symbols are already working... @connection.change_column :pg_arrays, :snippets, :text, array: true, default: "{}" |
@jigfox I think you hit a special case with I'll investigate and let you know what I find out. |
Okay, I just started writing that it seems to be a special case for I know I could have used |
The docs say:
The example uses a String but I agree that it should behave the same way if you use a Symbol. However patching |
psotgres seems to be the only database to support the array option |
@senny Thanks, that was pretty fast |
Closes #13146. This fixes an error when using: ``` change_colum :table, :column, :bigint, array: true ``` Conflicts: activerecord/CHANGELOG.md activerecord/test/cases/adapter_test.rb
@jigfox you're welcome. I backported the fix to |
Closes rails#13146. This fixes an error when using: ``` change_colum :table, :column, :bigint, array: true ```
change_colum :table, :column, :bigint, array: true
didn't work becausethe array option tried to string concat:
:bigint << '[]'
I don't know if this is the right place to convert the possible symbol
to a string. If it's wrong please let me know a better place and I will
change this.