Database helper class in ruby