On Friday, January 3, 2014, Joe O. wrote:

-   @owner ||= User.find_by_login(params[:user_id]) if
> params[:user_id].present?
> +   @owner ||= (User.find_by_login(params[:user_id]) if
> params[:user_id].present?)
> end
>
> What's going on here? How are these executed differently?
>

The first form is saying, if we got a uid, then check if the owner is nil,
and if so, find the user and assign it as owner.  The second reverses those
two checks.  The trick is that in the first form, the "if" applies to the
entire statement, not just the find.


-- 
Sent from Gmail Mobile; please excuse top posting, typos, etc. :-(