Instead of doing this, why not `add_index :<%= table_name %>, [:<%= attributes.map(&:name).join(", :") %>]`?