title: update attribute after create following condition applied to other attribute
body: <p>In a context of nested models and form fields, at the creation of the parent and input of a child's value (size), the goal is to apply a condition on the child's value to determine a subsequent value (product_id), all within the creation of parent action</p>
  
  <pre><code>class QuoteItem &lt; ActiveRecord::Base
    belongs_to :quote, :inverse_of =&gt; :quote_items
    belongs_to :product
  
  class Quote &lt; ActiveRecord::Base
    has_many   :quote_items, :inverse_of =&gt; :quote
  </code></pre>
  
  <p>This cannot be executed as a model method beforehand, as the model has no idea of params.
  An attempt to define an after_create callback for QuoteItem</p>
  
  <pre><code>  after_create :set_product 
    def set_product
      @quote_item.product_id = Product.where(['min &lt;= ? AND max &gt;= ?', @quote_item.size, @quote_item.size]).first.select[:id]    
    end
  </code></pre>
  
  <p>does not register the product id.</p>
  
  <p>A more succinct manner might be to reload the data via the controller. On action create</p>
  
  <pre><code>   respond_to do |format|
        if @quote_item.save
          set_product
          @quote_item.update_attribute([:quote_item][:product_id])
          format.html { redirect_to @quote_item, notice: 'Quote item was successfully created.' }
  </code></pre>
  
  <p>With identical NIL result</p>