title: Carrierwave and has_many
body: <p>I have Product model like this:</p>
  
  <pre><code>class Product &lt; ActiveRecord::Base
   has_many :images, :class_name =&gt; 'ProductImage', :order =&gt; 'position DESC', :dependent =&gt; :destroy
  
  def image_thumb
      images.first.image.thumb.url
    end
  
    def image
      images.first.image.url
    end
  end
  </code></pre>
  
  <p>ProductImage model:</p>
  
  <pre><code>class ProductImage &lt; ActiveRecord::Base
    attr_accessible :image, :position, :product_id, :title
  
    belongs_to :product
  
    default_scope order('position ASC')
  
    mount_uploader :image, ProductImageUploader
  end
  </code></pre>
  
  <p>Uploader model:</p>
  
  <pre><code>class ProductImageUploader &lt; CarrierWave::Uploader::Base
  ...
   def default_url
    asset_path([version_name, "default.jpg"].compact.join('_'))
   end
  end
  </code></pre>
  
  <p>But if I don't upload any image for product, I will get 'nil' in image_thumb and image methods. How get default_url if no one image uploaded and relation between Product and ProductImage models are one-to-many?</p>