Update ActiveRecord queries to use arel