To begin with this post in no ways undermines ActiveRecord. I am pretty happy with it, but for the sake of knowledge and to try a few options are there any other alternative
Another option is using DataMapper