Changing Alliances mid war season

If I change alliances mid war season, how does that impact my allocation of gems at the end of the war season? Is there a minimum number of wars I need to be in each season to get the gems? Is there a difference if I move up a level, down a level or move to an alliance in the same league? Is there anywhere here where this information is documented?

You need to spend the last 2 wars in an alliance to get season rewards.