diff --git a/app/models/ability.rb b/app/models/ability.rb index d78d54d64..5ca7f4ea6 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -217,10 +217,8 @@ class Ability ] end - def read_relations_with_projects(table = nil) - key = table ? 'project_id' : 'id' - table ||= 'projects' - + def read_relations_with_projects(table = 'projects') + key = table == 'projects' ? 'id' : 'project_id' ["#{table}.#{key} = ANY ( ARRAY ( SELECT target_id