Class: TicketsController

Inherits:
ApplicationController
  • Object
show all
Includes:
ControllerMixins::Authorization, ControllerMixins::Generic, ControllerMixins::Tickets
Defined in:
app/controllers/tickets_controller.rb

Instance Method Summary collapse

Methods included from ControllerMixins::Tickets

#create!

Instance Method Details

#createObject



16
17
18
# File 'app/controllers/tickets_controller.rb', line 16

def create
  create!(:ticket_path) # In ControllerMixins::Tickets module
end

#editObject



31
32
# File 'app/controllers/tickets_controller.rb', line 31

def edit
end

#newObject



13
14
# File 'app/controllers/tickets_controller.rb', line 13

def new
end

#showObject



20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/tickets_controller.rb', line 20

def show
  @work_units = WorkUnit.for_ticket(@ticket).sort_by_scheduled_at
  unless @ticket.estimated_hours
    flash.now[:notice] = "NOTE: The estimated amount of time to complete this ticket has not been entered."
  end

  if @ticket.percentage_complete.to_i > 100
    flash.now[:notice] = "WARNING: Ticket has exceeded the estimated amount of time to be completed."
  end
end

#updateObject



34
35
36
37
# File 'app/controllers/tickets_controller.rb', line 34

def update
  @ticket.update_attributes(params[:ticket])
  generic_save_and_redirect(:ticket, :update)
end