Convert some deprecated methods to modern arel syntax