It's not really a tutorial, but if you really want an advance discussion and in-depth coverage of ActiveRecord, I would recommend The Rails 4 Way which, in my opinion, is the best reference for back end development on Rails. I don't have any connection to the book or its authors, but I use it a lot.