if !params[:comment_id].blank? && @violation.review
@comment = @violation.review.comments.find(params[:comment_id])
end
+ @user_options = options_for_users()
render :partial => 'reviews/violation_comment_form'
end
sanitize_violation(violation)
unless violation.review
+ assignee = User.find params[:assignee_id]
violation.create_review!(
- :assignee => (params['assign_to_me']=='me' ? current_user : nil),
+ :assignee => assignee,
:user => current_user)
end
<% if @violation.review.nil? || @violation.review.comments.size==0 %>
- <%= check_box_tag "assign_to_me", "me", true -%> <label for="assign_to_me">Assign to me</label>
+ Assign to:
+ <%= select_tag "assignee_id", options_for_select(@user_options, current_user.id.to_s) %>
<% end %>
</td>
<td class="sep"></td>