Explore
Topics
Recent Comments
Related Posts
No related posts.
RightSprite iPhone DevWe have been publishing our own iPhone apps since the iPhone AppStore opened (first app on July 9th, 2008). Soon after we launched our apps we were talking to our friends in the technology community and realized that there is a need for application development for the iPhone. Thus became our business--half consultancy and half product company.
If in doubt, try try again
If in doubt, try try agin
On some recent projects I have seen the following code similar to:
User.find_by_login("noone").id rescue nil
So I just wanted to remind people of the try method.
User.find_by_login("noone").try(:id)
Personally I think try communicates the intent of the code.