fiedl/wingolfsplattform — pull request #16 by jbx26 (2014-01-20 23:07:07+00:00)
Title: Prevent errors in officer group structure and repair them in script

My intension:
I wanted to have a clean group structure and to prevent new errors in group structure
by raising an error when and
by returning a nil and
by repairing the group structure by deleting errornous groups.

My changes:
1. I provided a repair script which deletes officer groups which are under another officer group or an admin group. Call it
"bundle exec rake fix:officers_group_structure"
2. Raise an error when creating a special group with flag officer under a group with flag officer or admin.
3. Ignore this error when find_or_create and instead return nil
4. Check for .nil? in wingolf_groups script
5. In specs I replaced create_admins_parent_group by find_or_create_admins_parent_group so that in case of error a nil is used.