Treat ActiveRecord::Relation objects as arrays

Fixes #233.