title: implementing find_or_create_by when find involves single attribute but create involves multiple attributes
body: <p>In my Rails app I want to find a user by their email, or if the user does not exist, create one with that email as well as a few other attributes. Is there a less clunky way than the code below to do this, perhaps using <code>find_or_create_by</code>? </p>
  
  <pre><code>def set_user
    if self.user = User.find_by(email: recipient)
    else
      self.user = User.create(email: recipient,
                          password: Devise.friendly_token.first(6),
                          confirmed_at: DateTime.now)
    end
  end
  </code></pre>