I seem to be stuck trying to access hash values coming from a csv file and could use a different pair of eyes to point out the obvious mistake I'm making. Here is the relevant code:
CSV.foreach(filename, headers: true, header_converters: :symbol, converters: :all) do |row|
data = row.to_hash
id = data['studentid'] # (have also tried id = data[':studentid'] but there are no :'s in the csv file headers, and double quotes instead of single)
title = data['title'] # also (title = data[:title'])
logger.debug "data param: #{data.inspect}"
logger.debug "data title param: #{title.inspect}"
logger.debug "data studentid param: #{id.inspect}"
From the log file: (valid data x'ed out or fake - note studentid comes in as a fixnum)
data param: {:lastname=>"XXXX", :firstname=>"XXXXX", :title=>"XXXXXXX", :studentid=>123456, :date=>"XXXXXXXXXX"}
data title param: nil
data studentid param: nil
Rails 4.x Ruby 2.x OS Ubuntu Ideas?