Integer limit out of range should be allowed to raise. Closes #6272 #6349

Merged
merged 1 commit into from May 16, 2012

Projects

None yet

2 participants

@erichmenge

As it is if you enter an out of range :limit for a migration or new table, the raise is rescued and it defaults to integer. Based on change_schema_test.rb I guess it must have been because it was expected some people would use :limit => 11 for MySQL expecting an int(11), which isn't the same thing as an 11 byte int, which is what :limit is for.

I believe this should raise, if it isn't a valid value, rather than silently changing what the user has specified, wrong as it may be.

@erichmenge erichmenge closed this May 16, 2012
@erichmenge erichmenge reopened this May 16, 2012
@tenderlove tenderlove merged commit 4025efb into rails:master May 16, 2012
@erichmenge erichmenge deleted the erichmenge:patch-raise-type-errors branch Jan 25, 2013
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Jan 26, 2016
@kamipo kamipo Remove `limit: 11` as backward-compatibility with Rails 2.0
Integer limit as a byte size was introduced from Rails 2.1.
`limit: 11` is not a byte size, but take care for backward-compatibility
with Rails 2.0 (a892af6). Integer limit out of range should be allowed
to raise by #6349. I think we should remove this backward-compatibility.
9aedc64
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Jan 27, 2016
@kamipo kamipo Remove `limit: 11` as backward-compatibility with Rails 2.0
Integer limit as a byte size was introduced from Rails 2.1.
`limit: 11` is not a byte size, but take care for backward-compatibility
with Rails 2.0 (a892af6). Integer limit out of range should be allowed
to raise by #6349. I think we should remove this backward-compatibility.
9c97bf5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment