diff options
author | jessib <jessib@riseup.net> | 2012-10-16 15:51:35 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2012-10-16 15:51:35 -0700 |
commit | 48d6c2aac9ae2bf1c140e734a576e45289c99150 (patch) | |
tree | e52e003e635ee650fbe0981dc1cb4c29c409429e /help/app/controllers | |
parent | 56273c13f54a872d02db286c90a8d5103cf7a663 (diff) |
Some functional tests and other tweaks.
Diffstat (limited to 'help/app/controllers')
-rw-r--r-- | help/app/controllers/tickets_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/help/app/controllers/tickets_controller.rb b/help/app/controllers/tickets_controller.rb index f4b38de..be9a2b5 100644 --- a/help/app/controllers/tickets_controller.rb +++ b/help/app/controllers/tickets_controller.rb @@ -1,6 +1,7 @@ class TicketsController < ApplicationController respond_to :html #, :json + #has_scope :open, :type => boolean def new @ticket = Ticket.new @@ -8,9 +9,9 @@ class TicketsController < ApplicationController end def create - @ticket = Ticket.new #:created_by => User.current_test.id - @ticket.attributes = params[:ticket]#.except(:comments) + @ticket = Ticket.new(params[:ticket]) @ticket.created_by = User.current_test.id if User.current_test + @ticket.email = User.current_test.email if User.current_test.email #instead of calling add_comment, we are using comment_attributes= from the Ticket model flash[:notice] = 'Ticket was successfully created.' if @ticket.save @@ -35,6 +36,7 @@ class TicketsController < ApplicationController def update @ticket = Ticket.find(params[:id]) @ticket.attributes = params[:ticket] + #add_comment #or should we use ticket attributes? # @ticket.save if @ticket.save |