title: Get a dynamic column value in Activerecord Select statement
body: <p>I have a model named Product and I want to get the <code>id</code>, <code>name</code> and a dynamically calculated attribute value from ActiveRecord <code>SELECT</code> statement. <code>Product</code> model has <code>id</code>, <code>name</code>, <code>product_type</code> attributes.
  Currently what I am trying is using an SQL like approach</p>
  
  <pre><code>Product.select("id, name, CASE WHEN product_type = 'AB' THEN 'xyz1' WHEN product_type = 'BC' THEN 'xyz2' END AS custom_value")
  </code></pre>
  
  <p>Which translates to the following Raw SQL</p>
  
  <pre><code>SELECT id, name, 
    CASE 
     WHEN product_type = 'AB' THEN 'xyz1'
     WHEN product_type = 'BC' THEN 'xyz2'
    END AS custom_value
  FROM Product
  </code></pre>
  
  <p>but this approach does not return the column computed at runtime, it only returns the <code>id</code> and <code>name</code> columns for the <code>Product</code> record.</p>