Variants inline syntax v2

Previous solution was reverted after David discovered few issues (https://github.com/rails/rails/pull/13235). This version is different approach, less naive, with better test coverage for real world use cases.

/cc @dhh @jeremy