Merge pull request #12222 from rcillo/fix-custom-flash

Custom flash should be defined only for the class that defines it and it's subclasses

Fixes #12057
Conflicts:
	actionpack/CHANGELOG.md