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
Remove rescue that is oculting exceptions on integer columns #7509
Conversation
I love your use of 'occulting.' |
I think is better to backport #6092 that has a better test coverage. But first I want to ask: All the tests are passing in all the ruby version? |
All tests are green on Ruby 1.9.3. |
@rafaelfranca I could backport that commit on #6092. also, if we want to keep compatibility between the code on master / 3.2 branch, we need to change and add tests to this line on master branch: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/column.rb#L117 |
I don't think we need to add tests to this line in master because it is not used in the Rails code anymore. It is only there to backward compatibility with others adapters. I think all the adapters are not using this code anymore. Also we need to test with ruby 1.8.7 before merge. |
Hm yeah, I think it'd be good to backport that particular commit since it adds tests around the column itself as well, and adding your test as a separate commit would help ensuring the problem is fixed from the association point of view. Thanks bro. |
One thought - the previous code looks like it's designed to help out people who've misdeclared boolean fields as integer - |
@rafaelfranca all tests are passing on Ruby 1.8.7. Also, I backported the tests from #6092. I think it's ready to merge. |
Yes, Changelog entry would be great. @tchandy could you add it? This pull request is ready to merge |
@rafaelfranca done. |
Please squash your commits |
@rafaefranca squashed. see #7582. |
In Rails 3.2.9 I'm seeing a problem when trying to manage my own primary keys (works with 3.2.8):
Is there any workaround for that? |
@amuino I didn't get you problem. If the primary key is a integer it is expected that it will call Also, I don't think this is related to this pull request. They |
We have an I thought it might be related to these changes. |
If |
I'm quite confident it is a VARCHAR
|
Hi Folks,
I found this weird behavior when I was programming during my day job. This is the scenario:
so I was building a part of the application, and I made the following mistake, passing a object to the integer field:
whenever this code runs, the user_id always became 1, not raising a error or anything. So I took a look in the rails source, and found that this behavior is fixed in rails master, but not in the 3.2 tree.
I think this could be considered a bug, so I did this patch. What you guys think?