title: ActiveRecord: How to interpolate attribute value to a custom validation errror message?
body: <p>I have a <code>validates_presence_of :price</code> validation, which returns a <code>"Book version price can't be blank"</code> error when the validation fails. </p>
  
  <pre><code>class BookVersion &lt; ActiveRecord::Base
    attr_accessible :name, :book_id, :instock, :isbn, :price, :famis_price, :famis_number, :weight_in_pounds,
                    :width, :height, :thickness
  
    validates_presence_of :price, message: "can't be blank"
  </code></pre>
  
  <p>However, I want to add the <code>name</code> value of the BookVersion to the validation message like so:</p>
  
  <p>If <code>book_version.name</code> returns "LB":</p>
  
  <p><code>Book version LB price can't be blank</code></p>
  
  <p>So I want to do something like:</p>
  
  <pre><code>validates_presence_of :price, message: "#{self.name} can't be blank"
  </code></pre>
  
  <p>but that is returning <code>Book version price BookVersion can't be blank</code>, which isn't what I want</p>