civil war battlefield db logic using ruby