title: If select SQL command work for Rails Model transaction?
body: <p>I have searched and found the sample:</p>
  
  <pre><code>Account.transaction do 
    paul.deposit(10)
    peter.withdraw(10) 
  end
  </code></pre>
  
  <p>I guess the transaction working as that "when a transaction done, begin to do another transaction". deposit/withdraw is a update SQL command. if i can use select(query) SQL command in that like this sample?</p>
  
  <pre><code>Account.transaction do
    condition = person.where("name='paul' and money&gt;=100'").count  # query SQL command
    if condition&gt;0
        paul.deposit(10)
    end 
  end
  </code></pre>
  
  <p>All sample i found is update SQL transaction sample.
  can i guess this code work without error value, if there are two transaction ?</p>