Commit c49ea05e7adf235f8e9091f053e1bd5e7c1409e6

Authored by Barry Hess
Committed by Nick Recobra
1 parent 7f883b12
Exists in master and in 1 other branch production

Actually fix bug in finding app for dpeloying index screen. For real.

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
app/controllers/deploys_controller.rb
... ... @@ -15,7 +15,9 @@ class DeploysController < ApplicationController
15 15 end
16 16  
17 17 def index
18   - app = current_user.apps.find(params[:app_id]).first
  18 + # See AppsController#find_app for the reasoning behind this code.
  19 + app = App.find(params[:app_id])
  20 + raise(Mongoid::Errors::DocumentNotFound.new(App,app.id)) unless current_user.admin? || current_user.watching?(app)
19 21  
20 22 @deploys = app.deploys.order_by(:created_at.desc).paginate(:page => params[:page], :per_page => 10)
21 23 end
... ...