By the way, index column order DOES matter to some DBMS’s such as PostgreSQL. In the case, you’ll want to consider the order in which columns are considered in the generated SQL statements from ActiveRecord.
In my own limited testing, AR seems to generate “id” then “type”, for the association’s WHERE clause. So your last example index would correctly cover it!
index :comments, [:commentable_id, :commentable_type]