I have a hash like so:
{
"feid"=>32,
"fid"=>11,
"fipl"=>11,
}
I want to save each value to it's respective column in a database.
I know I can do the following
record = Metric.new
record.feid = hash['feid']
record.fid = hash['fid']
record.fipl = hash['fipl']
record.save
But my hash is a lot longer than 3 elements and there must be much more simple way!
record.update_attributes(hash)... if record already exists,