File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -329,15 +329,17 @@ def commit_logtime_activity
329
329
# Returns a :conditions SQL string that can be used to find the issues associated with this project.
330
330
#
331
331
# Examples:
332
- # project.project_condition(true) => "(projects.id = 1 OR (projects. lft > 1 AND projects.rgt < 10) )"
332
+ # project.project_condition(true) => "(projects.lft >= 1 AND projects.rgt <= 10)"
333
333
# project.project_condition(false) => "projects.id = 1"
334
334
def project_condition ( with_subprojects )
335
- cond = "#{ Project . table_name } .id = #{ id } "
336
335
if with_subprojects
337
- cond = "(#{ cond } OR (#{ Project . table_name } .lft > #{ lft } AND " \
338
- "#{ Project . table_name } .rgt < #{ rgt } ))"
336
+ "(" \
337
+ "#{ Project . table_name } .lft >= #{ lft } AND " \
338
+ "#{ Project . table_name } .rgt <= #{ rgt } " \
339
+ ")"
340
+ else
341
+ "#{ Project . table_name } .id = #{ id } "
339
342
end
340
- cond
341
343
end
342
344
343
345
def self . find ( *args )
You can’t perform that action at this time.
0 commit comments