Clean up auto complete builder to fix ActiveRecord deprecation warnings.