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

Prevent RangeError for belongs_to associations #25280

Merged

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Jun 4, 2016

Currently to access belongs_to associations raises a RangeError if
foreign key attribute has out of range value.
It should return a nil value rather than raising a RangeError.

Fixes #20140.

@rails-bot
Copy link

r? @kaspth

(@rails-bot has picked a reviewer for you, use r? to override)

@kamipo kamipo force-pushed the prevent_range_error_for_belongs_to_associations branch 3 times, most recently from c89a0ad to dbd0863 Compare June 5, 2016 06:36
@kaspth
Copy link
Contributor

kaspth commented Jun 7, 2016

r? @sgrif

@rails-bot rails-bot assigned sgrif and unassigned kaspth Jun 7, 2016
@kamipo kamipo changed the title Prevent RangeError for belongs_to associatons Prevent RangeError for belongs_to associations Jun 14, 2016
@kamipo kamipo force-pushed the prevent_range_error_for_belongs_to_associations branch 4 times, most recently from ad08ddb to c32bc15 Compare June 16, 2016 06:40
@kamipo kamipo force-pushed the prevent_range_error_for_belongs_to_associations branch from c32bc15 to b0e460f Compare June 26, 2016 23:43
@kamipo kamipo force-pushed the prevent_range_error_for_belongs_to_associations branch 2 times, most recently from c1c8b56 to dc45482 Compare August 6, 2016 07:11
@kamipo kamipo force-pushed the prevent_range_error_for_belongs_to_associations branch from dc45482 to c969bfe Compare September 14, 2016 10:04
Currently to access `belongs_to` associations raises a `RangeError` if
foreign key attribute has out of range value.
It should return a nil value rather than raising a `RangeError`.

Fixes rails#20140.
@kamipo kamipo force-pushed the prevent_range_error_for_belongs_to_associations branch from c969bfe to 0da4a08 Compare October 10, 2016 02:41
@sgrif sgrif merged commit 753da21 into rails:master Dec 10, 2016
@thomasfedb
Copy link
Contributor

Excellent! 👌

@kamipo kamipo deleted the prevent_range_error_for_belongs_to_associations branch December 10, 2016 12:25
kamipo added a commit to kamipo/rails that referenced this pull request Dec 10, 2016
matthewd added a commit that referenced this pull request Dec 10, 2016
Fix CI failure caused by #25227 and #25280 were merged at the same time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants