Skip to content

Commit

Permalink
Merge pull request #1144 from sparc-request/jl-add-service-bug
Browse files Browse the repository at this point in the history
JL - add service bug
  • Loading branch information
Stuart-Johnson committed Oct 5, 2017
2 parents 7f475f6 + 9c451b9 commit 8d60354
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/protocols_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def create
@service_request.update_attribute(:status, 'draft')
@service_request.sub_service_requests.update_all(status: 'draft')

@protocol.update_attribute(:next_ssr_id, @service_request.sub_service_requests.count + 1)
last_ssr_id = @service_request.sub_service_requests.sort_by(&:ssr_id).last.ssr_id.to_i

@protocol.update_attribute(:next_ssr_id, last_ssr_id + 1)

if USE_EPIC && @protocol.selected_for_epic
@protocol.ensure_epic_user
Expand Down

0 comments on commit 8d60354

Please sign in to comment.