Skip to content

Commit

Permalink
[view] fixes ticket creation to not 500 error on show page and includ…
Browse files Browse the repository at this point in the history
…e owner_id
  • Loading branch information
FotoVerite committed Apr 3, 2013
1 parent 08efbe3 commit 721550a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/models/ticket.rb
Expand Up @@ -24,6 +24,8 @@ class Ticket < ActiveRecord::Base

validates :name, :presence => true
validates :ticket_group_id, :presence => {:message => "Ticket must be assign to a Ticket Group"}
#validates :owner_id, :presence => {:message => "You must assign a ticket to a user"}


STATUSES = ['open', 'closed', 'pending']

Expand Down
4 changes: 2 additions & 2 deletions app/views/tickets/_form.html.erb
Expand Up @@ -20,8 +20,8 @@


<div class="field">
<%= f.label :creator_id, "Assigned To" %>
<%= f.collection_select :creator_id, User.all, :id, :full_name %>
<%= f.label :owner_id, "Assigned To" %>
<%= f.collection_select :owner_id, User.all, :id, :full_name %>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/tickets/show.html.erb
Expand Up @@ -16,7 +16,7 @@

<p>
<strong>Assigned To:</strong>
<%= @ticket.assignee.full_name %>
<%= @ticket.assignee ? @ticket.assignee.try(:full_name) : 'None' %>
</p>

<p>
Expand Down

0 comments on commit 721550a

Please sign in to comment.