title: Using an attr within a model
body: <p>Hey so I'm trying to use the :id attribute of a model within the model but i cannot figure it out.</p>
  
  <pre><code> require 'zip/zip'
   require 'zip/zipfilesystem'
  
   class Lesson &lt; ActiveRecord::Base
   attr_accessible :attachment, :course_id, :goal, :title, :assets_attributes
   belongs_to :course
   has_many :assets, :dependent =&gt; :destroy
   accepts_nested_attributes_for :assets, :reject_if =&gt; lambda { |a| a[:asset_file_name].blank? }
  
  
   def bundle
   bundle_filename = 'public/attachments/#{@lesson.id}.zip'
  
   Zip::ZipFile.open(bundle_filename, Zip::ZipFile::CREATE) {
     |zipfile|
     self.assets.collect {
       |asset|
         zipfile.add( "#{asset.id}", "public/attachments")
       }
   }
  
  File.chmod(0644, bundle_filename)
  self.save
  end
  end
  </code></pre>
  
  <p>im having issues in the   bundle_filename = 'public/attachments/#{@lesson.id}.zip'</p>
  
  <p>specifically @lesson.id part.</p>
  
  <p>any ideas?</p>