Truncate table to reset id back to 1

What im using now is ActiveRecord::Base.connection.execute(‘TRUNCATE
table_products’) to reset the id back to 1. Is there another way without
using direct sql command to reset the id back to 1?

in mysql:

ALTER TABLE

SET AUTO_INCREMENT = 1