Fix ActiveRecord `subclass_from_attrs` when eager_load is false.
It cannot find subclass because all classes are loaded automatically
when it needs.
If an index can't be found by column, use the index name.

schema_statements uses the column name by default to construct the index name, and then raises an exception if it doesn't exist, even if the name option is specified, which causes #8858.  this commit makes index_name_for_remove fall back to constructing the index name to remove based on the name option.
Merge pull request #8868 from tehgeekmeister/master

Use the index name explicitly provided in a migration when reverting.

Fixes #8868

Conflicts:
	activerecord/CHANGELOG.md
Fix rails console --sandbox

I've also added a proper acceptance test which reproduced the issue.

Closes #9513, #9515.
Refactored test case with standard variable naming
Merge pull request #9611 from choudhuryanupam/master

Refactored test case with standard variable names
Merge pull request #9497 from route/subclass_from_attrs

Fix ActiveRecord `subclass_from_attrs` when eager_load is false.

Conflicts:
	activerecord/CHANGELOG.md
Avoid short-circuit return
Make sure options is a hash
The console --sandbox transaction should not be joinable

Thanks @neerajdotname for noticing this bug.