Train system using ruby and sql to save to a databse