fiedl/wingolfsplattform — pull request #18 by jbx26 (2014-01-25 23:14:21+00:00)
Title: Jb/477 repair menu

My intension:
I wanted to calculate the correct path from the user to his corporation.
Correct means:
* No admin or officer groups
* No other special groups like Wingolfsblätter-Abonnent or similar
* No guest membership
* First corporation
* Last valid group in the corporation

My changes:
1. I introduced a new cache entry for the last group in the first corporation
2. The cache is deleted when user's UserGroupMembership is destroyed.
3. New method Group#is_special_group? and Officers#is_special_group?
4. sort_by(valid_from) with default value to prevent nil exception
5. The new method User#cached_last_group_in_first_corporation is used to calculate the ancestor_navables

The effect:
You can see the horizontal and vertical navigation to be based on the last group of the first corporation instead of the first group ever entered.