title: DEPRECATION WARNING: You're trying to create an attribute `info', in Rails 3.2.8
body: <p>I am trying to add pdf generation through Prawn to my Rails 3 app. I am following the Railscast and all was going well until I try to pass an instance variable from my controller to a separate class I created.</p>
  
  <p>The controller action looks like this:</p>
  
  <pre><code>def show #shows some material
  @material = Material.find(params[:id])
  respond_to do |format|
    format.html
    format.pdf do
      pdf = MaterialPdf.new(@material)
      send_data pdf.render, filename: "material_#{@material.id}.pdf", 
                            type: "application/pdf",
                            disposition: "inline"
    end
  end
  </code></pre>
  
  <p>end</p>
  
  <p>and the material_pdf.rb file looks like this:</p>
  
  <pre><code>class MaterialPdf &lt; Prawn::Document
    def initialize(material)
      super
      @material = material
      text "Placeholder text"
    end
  end
  </code></pre>
  
  <p>The error message I'm getting from the log is weird:</p>
  
  <pre><code>Material Load (0.1ms)  SELECT "materials".* FROM "materials" WHERE "materials"."id" = ? ORDER BY materials.created_at DESC LIMIT 1  [["id", "27"]]
  DEPRECATION WARNING: You're trying to create an attribute `info'. Writing arbitrary attributes on a model is deprecated. Please just use `attr_writer` etc. (called from initialize at .../app/pdfs/material_pdf.rb:3)
  </code></pre>
  
  <p>It's odd because the query looks fine and I'm NOT trying to create an attribute 'info'. I don't get it. Help.</p>