Make HashWithIndifferentAccess#select always return the hash.

Hash#select! returns nil if the hash didn't change and thus behaves differently
from select, so it's return value can't be used as result for the latter.
Merge pull request #11327 from schuetzm/hash-with-indifferent-access-select

Make HashWithIndifferentAccess#select always return the hash.
Extract common query to a constant.

Perf ref: https://gist.github.com/vipulnsward/8209749201dfdd678c97
Merge pull request #11329 from vipulnsward/cache_one

Extract common query to a constant.
Remove action view test duplication

Same test exists above 2 or 3 lines.
Merge pull request #11332 from sanemat/fix/av-test-duplication

Remove actionview test duplication
Stop swallowing exceptions from`after_commit` callbacks

also

Rollback a transaction only if we have neither finished committing nor rolling back