require 'travis'

class TasksController < ApplicationController
  responders :rabl
  respond_to :json

  def show
    respond_with task
  end

  # also responds to PUT /builds/:id legacy route
  def update
    @task = Task.find(params[:id], :select => "id")
    @task.update_attributes(params[:task] || params[:build])
    render :nothing => true
  end

  # also responds to PUT /builds/:id/log legacy route
  def log
    Task.append_log!(params[:id], params[:task] ? params[:task][:log] : params[:build][:log])
    render :nothing => true
  end

  protected

    def task
      @task ||= Task.find(params[:id])
    end
end


require 'travis'

class TasksController < ApplicationController
  responders :rabl
  respond_to :json

  def show
    respond_with task
  end

  # also responds to PUT /builds/:id legacy route
  def update
    task.update_attributes(params[:task] || params[:build])
    render :nothing => true
  end

  # also responds to PUT /builds/:id/log legacy route
  def log
    Task.append_log!(params[:id], params[:task] ? params[:task][:log] : params[:build][:log])
    render :nothing => true
  end

  protected

    def task
      @task ||= Task.find(params[:id])
    end
end


Revert "Do not load full build log when we builds are finalized"
Revert "Do not load full build log when we builds are finalized"

This reverts commit 6f8d5260a91a8bbc3e9c148b00ae65c65c0ba8aa.

It breaks some specs. I will wait for Sven to tell me what I may be
missing.
