In irb:

   foo = "hi"
   foo ||= "bye"
   p foo
   bar ||= "woo"
   p bar

||=, AKA "or equals" is a way to say `foo = "value" unless foo`


On Tuesday, October 8, 2013, Carter wrote:

> In models/user.rb:
>
> > @@ -0,0 +1,36 @@
> > +class User < ActiveRecord::Base
> > +  validates :email, :presence => true, :uniqueness => true
> > +  validates :name, :presence => true
> > +  validate :password_is_set
> > +  validate :email_matches_proper_format
> > +
> > +  include BCrypt
> > +
> > +  def password
> > +    @password ||= Password.new(password_hash) if password_hash
>
> confused by line 10. googled around a bit. what's happening here? '|| ='
> does not compute in my brain.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/gopher-snakes-2013/thunder/pull/4/files#r6847609>
> .
>