Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't raise NoMethodError the tried method doesn't exists
- Loading branch information
Showing
2 changed files
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29a5aea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could somebody please explain this change?
As I understand it, the purpose of
Object#try
is to call a method on an object of an expected class, but that could also benil
. In what situation would you want to silently avoid aNoMethodError
? If I'mtry
ing a method that doesn't exist in my expected class, I should know about it.29a5aea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On STI objects where you might have methods defined for some records, but not for others for example.
29a5aea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
29a5aea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I think we should revert this.
29a5aea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 to this change as well. It's not acceptable to radically change the behavior at this point.
29a5aea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
29a5aea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit 587dd7d also need to revert the fix the failing test. Or might need a fix!
587dd7d commit is not having test.