earnings_controller.rb 419 Bytes
Newer Older
1
2

class EarningsController < ApplicationController
3

4
5
  before_filter :set_earning, :only => [:cancel]

6

7
8
  # TODO user should be set
  def cancel
9
10
11
    if @earning.cancel!(current_hacker)
      flash[:warning] = "#{@earning.points} storniert"
    end
12
13
14
15
    redirect_to :back
  end


16
17
18
19
  #################
  ##  Protected  ##
  #################

20
21
22
23
24
25
  protected

  def set_earning
    @earning = Earning.find(params[:id])
  end
end