Skip to content

Commit

Permalink
[webui] Cleanup maintenance_incidents method
Browse files Browse the repository at this point in the history
  • Loading branch information
bgeuken committed Jan 25, 2016
1 parent 3d1a6ae commit 53c56a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/api/app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1570,9 +1570,11 @@ def find_incident_issues

# Returns maintenance incidents by type for current project (if any)
def maintenance_incidents
all = Project.where('projects.name like ?', "#{self.name}:%").distinct.where(kind: 'maintenance_incident')
all = all.joins(:repositories).joins('JOIN release_targets rt on rt.repository_id=repositories.id')
all.where('rt.trigger = "maintenance"')
Project.where('projects.name like ?', "#{self.name}:%").distinct.
where(kind: 'maintenance_incident').
joins(:repositories).
joins('JOIN release_targets rt on rt.repository_id=repositories.id').
where('rt.trigger = "maintenance"')
end

def release_targets_ng
Expand Down

0 comments on commit 53c56a1

Please sign in to comment.