refactoring according to Alexander's comments
This commit is contained in:
parent
5102e8bd86
commit
43fc57ec37
|
@ -217,10 +217,8 @@ class Ability
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
def read_relations_with_projects(table = nil)
|
def read_relations_with_projects(table = 'projects')
|
||||||
key = table ? 'project_id' : 'id'
|
key = table == 'projects' ? 'id' : 'project_id'
|
||||||
table ||= 'projects'
|
|
||||||
|
|
||||||
["#{table}.#{key} = ANY (
|
["#{table}.#{key} = ANY (
|
||||||
ARRAY (
|
ARRAY (
|
||||||
SELECT target_id
|
SELECT target_id
|
||||||
|
|
Loading…
Reference in New Issue