hpi-swt2 / bookkeeper-portal-red

Bookkeeper Portal—🟥 Edition
MIT License
9 stars 1 forks source link

fix: permissions can't be deleted #404

Closed MatthiasCr closed 1 year ago

MatthiasCr commented 1 year ago

The sql query

@item.permissions.joins(:group).where.not('groups.tag': "personal_group")

does only detect groups with tag "everyone_group" NOT the groups with tag nil. Therefore it does not delete the normal groups which leads to their duplication. If you do the opposite and don't use not it works:

@item.permissions.joins(:group).where('groups.tag': [nil, "everyone_group"])

resolves #398

MatthiasCr commented 1 year ago

don't know why the test is now failing ¯_(ツ)_/¯