Over the years, there have been database abstraction libraries created for ruby that try to fix some of these shortcomings.