I'm new to rails and ruby... How can i refactor such code, which import's from csv file data? Now i have such code
if row[qnt].to_s != ""
eqnt = /(\d+)/.match(row[qnt])[0].to_s
else
eqnt = 0
end
I try something like
if row[qnt].present?
eqnt = /(\d+)/.match(row[qnt])[0].to_s
else
eqnt = 0
end
But is it equal, and also what else could i do to get code smaller?