title: Filenames in paperclip
body: <p>Hey so I have a class called Asset and each Asset has an :attachment. I want to take the :basename.:extension of the uploaded file and store it in the :asset_file_name. How do I go about doing so? here is my class:</p>
  
  <pre><code>    class Asset &lt; ActiveRecord::Base
      attr_accessible :asset_file_name, :lesson_id, :attachment
  
      #allows us to use :lesson_id in :url
      Paperclip.interpolates :lesson_id do |attachment, style|
      attachment.instance.lesson_id
      end
  
      has_attached_file :attachment,
      :url =&gt; "/attachments/:lesson_id/:basename.:extension",
      :path =&gt; ":rails_root/public/attachments/:lesson_id/:basename.:extension"
  
      validates_presence_of :asset_file_name
      validates_attachment_presence :attachment
  
      end
  </code></pre>