Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kg ssr submitted at fixes #662

Merged
merged 5 commits into from Sep 12, 2016
Merged

Kg ssr submitted at fixes #662

merged 5 commits into from Sep 12, 2016

Conversation

Stuart-Johnson
Copy link
Collaborator

No description provided.

@ying-pbrc
Copy link
Collaborator

don't forget to add submitted_at to the white list of the sub_service_request model attributes

@ying-pbrc
Copy link
Collaborator

Also, in db/migrate/20160908144020_add_submitted_at_to_sub_service_request.rb:

  • SubServiceRequest.all.each do |ssr|
  •  past_status = ssr.past_statuses.order('date').last
    
  •  unless past_status.nil?
    
  •    ssr.update_attribute(:submitted_at, past_status.date)
    
  •  end
    
  • end

In each loop, 1) we probably should only considered those past statuses with a draft status, 2) only set ssr.submitted_at value if the status is not draft:

past_status = ssr.pass_statuses.where(status: 'draft').order('date').last

unless past_status.nil? || ssr.status == 'draft'

@jleonardw9 jleonardw9 merged commit 4fa03d1 into master Sep 12, 2016
@jleonardw9 jleonardw9 deleted the kg-ssr_submitted_at_fixes branch September 12, 2016 18:32
ying-pbrc added a commit to PBRCDev/sparc-request that referenced this pull request Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants