title: Cannot import completely CSV file
body: <p>I used this code to import my CSV file to table:</p>
  
  <pre><code>def Hotel.import(file)
    allowed_attributes = ["id", "name", "area", "short_name", "zip", "address", "tel", "fax", "staff_name", "information", "created_at", "updated_at"]
    CSV.foreach(file.path, headers: true) do |row|
      product = find_by_id(row["id"]) || new
      product.attributes = row.to_hash.select{ |k,v| allowed_attributes.include? k }
      product.save!
    end
  end
  
  def import
    Hotel.import(params[:file])
    redirect_to root_url, notice: "Product Imported."
  end
  </code></pre>
  
  <p>However, this code only insert id, created_at, and updated_at field to table. The insert command show here:</p>
  
  <pre><code>INSERT INTO `hotels` (`created_at`, `updated_at`) VALUES ('2014-04-10 07:50:23', '2014-04-10 07:50:23')
  </code></pre>
  
  <p>I'm using rails 4.0 and ruby 2.0 to do this project. I check carefully to find error but I cannot find any problems here, so please tell me where I was wrong?</p>