------art_81103_5770294.1168631891324
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

It does the following in this order:

if @account HAS A VALUE (is not nil) then DO NOTHING
  otherwise, compute Account.find(...) and set its return value into
@account.

It is useful whenever you want to avoid computing something if it already
holds a value.

Pedro.

On 1/12/07, Justin Ko <jko170 / yahoo.com> wrote:
>
> I'm looking at this method and don't understand what || eans:
>
> def current_account
>     @account || ccount.find(session[:account_id])
> end
>
> I have the ruby for rails book and can't find anything on it.
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


-- 
Pedro Fortuny Ayuso
C/Capuchinos 14, 1. 47006 Valladolid. SPAIN
http://pfortuny.sdf-eu.org

------art_81103_5770294.1168631891324--