title: How to refactor long if statements
body: <p>I have this nested if statement, and i can't figure out how to refactor it... It's properly pretty simple but i just can't get the right idea, hope someone can help.</p>
  
  <p>First i have a nested if statement (bad):</p>
  
  <pre><code>unless record.valid?
    if condition_1
      action_1
    elsif condition_2
      action_2
    elsif condition_3
      action_3
    end
  end
  </code></pre>
  
  <p>Then i tried this, but that doesn't look any better (if-statement without anything inside is bad too):</p>
  
  <pre><code>if record.valid?
    # do nothing
  elsif condition_1
    action_1
  elsif condition_2
    action_2
  elsif condition_3
    action_3
  end
  </code></pre>
  
  <p>Do anyone have a idea on how to refactor these statements so it looks better?</p>
  
  <h2>Update: solution (based on @thomasfedb and @undur_gongor)</h2>
  
  <p>What i end up doing was simply:</p>
  
  <pre><code>return if record.valid?
  
  if condition_1
    action_1
  elsif condition_2
    action_2
  elsif condition_3
    action_3
  end
  </code></pre>