Aloha, as always, any help is greatly appreciated. I'm importing a CSV and in the headers I have all caps and colons (for example, EXT:MAT:PIDTC is one). How would I go about manipulating the headers on the way in? maybe I want to change the example above to thisHeader or something to match up with my :thisHeader attribute in my SpiritTrial model.
class SpiritTrial < ActiveRecord::Base
def self.import(file)
CSV.foreach(file.path, headers: true) do |row|
SpiritTrial.create! row.to_hash
end
end
end