Class: DeploysController

Inherits:
ApplicationController show all
Defined in:
app/controllers/deploys_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#stored_location_for

Instance Method Details

#createObject


8
9
10
11
12
# File 'app/controllers/deploys_controller.rb', line 8

def create
  @app = App.find_by_api_key!(params[:api_key])
  @deploy = @app.deploys.create!(default_deploy || heroku_deploy)
  render :xml => @deploy
end

#indexObject

Raises:

  • (Mongoid::Errors::DocumentNotFound)

14
15
16
17
18
19
20
21
22
# File 'app/controllers/deploys_controller.rb', line 14

def index
  # See AppsController#find_app for the reasoning behind this code.
  app = App.find(params[:app_id])
  raise Mongoid::Errors::DocumentNotFound.new(App, app.id) unless current_user.admin? || current_user.watching?(app)

  @deploys = Kaminari.paginate_array(app.deploys.order_by(:created_at.desc)).
    page(params[:page]).per(10)
  @app = app
end