summaryrefslogtreecommitdiff
path: root/help/app/controllers/tickets_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'help/app/controllers/tickets_controller.rb')
-rw-r--r--help/app/controllers/tickets_controller.rb6
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