title: Convert save/update call rails to sql
body: <p>I want to get the sql generated on running </p>
  
  <p><code>.save</code></p>
  
  <p>when I run this command in console</p>
  
  <pre><code>irb(main):018:0&gt; a = User.last
  irb(main):018:0&gt; a.first_name
  =&gt; "Mohan"
  irb(main):019:0&gt; a.first_name = 'Sohan'
  =&gt; "Sohan"
  irb(main):020:0&gt; a.save
     (2.0ms)  BEGIN
    SQL (1.4ms)  UPDATE `users` SET `first_name` = 'Sohan', `updated_at` = '2017-02-15 14:00:10' WHERE `users`.`id` = 1
     (31.3ms)  COMMIT
  =&gt; true
  </code></pre>
  
  <p>This actually updates the record. I want to know the sql query generated without updating the record.</p>
  
  <p>I tried using <a href="http://apidock.com/rails/ActiveRecord/Relation/to_sql" rel="nofollow noreferrer"><code>.to_sql</code></a> but that seems to work only for relations.</p>