This project is archived and is in readonly mode.
Allow optional arguments and/or block for Object#try
Reported by Eloy Duran | November 21st, 2008 @ 08:53 AM | in 2.x
As suggested by Pat Nakajima in the comments of: http://github.com/rails/rails/co...
No patch was submitted yet, but I needed this behaviour, so here it is.
Comments and changes to this ticket
-
Luciano G. Panaro November 21st, 2008 @ 02:36 PM
Based on Eloy's patch I added the option of using a dynamic try_* method instead of calling try directly.
So you would do @person.try_name (instead of @person.try(:name), even though you can still do that too).
Any thoughts?
-
Repository November 24th, 2008 @ 05:54 PM
- State changed from new to resolved
(from [823b623fe2de8846c37aa13250010809ac940b57]) Allow optional arguments and/or block for Object#try like Object#send does. [#1425 state:resolved]
Original suggestion by Pat Nakajima.
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1425 Allow optional arguments and/or block for Object#try (from [823b623fe2de8846c37aa13250010809ac940b57]) Allow o...