My table field names are lowercase and the field names I get from CSV files are camelcase. Is there anyway I can convert the keys of an array of hashes to lowercase?
Here is the code I have right now:
CSV.foreach(file, :headers => true) do |row|
Users.create!(row.to_hash)
end
This is failing because the keys are camel case (I've verified this by manually editing the file to make the header row all lowercase).
PS. Also I would love to know why the hell rails takes table field names' case sensitivity into play to begin with?