On Mar 4, 2015, at 8:32 AM, Daniel Loureiro <[email protected]> wrote:
> 
> Hi everyone,
> 
> it's a silly question (and I'm kind of ashamed to ask it), but I frequently 
> must do things like that:
> 
> a.present? ? a : b

a.presence || b

<http://api.rubyonrails.org/classes/Object.html#method-i-presence>

-- 
Scott Ribe
[email protected]
http://www.elevated-dev.com/
(303) 722-0567 voice




-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/65CA78F2-522D-4D4D-B6DD-A1F399C06142%40elevated-dev.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to