Skip to content

Commit

Permalink
Remove usage of deprecated argument. Fixes sparc-request#1194
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisortman committed Nov 27, 2017
1 parent 952414c commit 5ba725c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions lib/tasks/match_identity_with_professional_organization.rake
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ task :match_identity_with_professional_organization => :environment do
unassigned_identities = Identity.all.where(professional_organization_id: nil)
identities_with_key = unassigned_identities.where(department: key)
identities_with_key.each do |identity_with_key|
identity_with_key.assign_attributes({ professional_organization_id: value, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_with_key.assign_attributes({ professional_organization_id: value, audit_comment: "BY SCRIPT" })
identity_with_key.save
end
end
Expand All @@ -118,13 +118,13 @@ task :match_identity_with_professional_organization => :environment do

identities_with_key.each do |identity_with_key|
if identity_with_key.college == 'college_of_graduate_studies'
identity_with_key.assign_attributes({ professional_organization_id: value.first['graduate'], audit_comment: "BY SCRIPT" }, without_protection: true)
identity_with_key.assign_attributes({ professional_organization_id: value.first['graduate'], audit_comment: "BY SCRIPT" })
identity_with_key.save
elsif identity_with_key.college == 'college_of_medicine'
identity_with_key.assign_attributes({ professional_organization_id: value.first['medicine'], audit_comment: "BY SCRIPT" }, without_protection: true)
identity_with_key.assign_attributes({ professional_organization_id: value.first['medicine'], audit_comment: "BY SCRIPT" })
identity_with_key.save
elsif identity_with_key.college == 'college_of_pharmacy'
identity_with_key.assign_attributes({ professional_organization_id: value.first['pharmacy'], audit_comment: "BY SCRIPT" }, without_protection: true)
identity_with_key.assign_attributes({ professional_organization_id: value.first['pharmacy'], audit_comment: "BY SCRIPT" })
identity_with_key.save
else
# These identities need to be added to the unmatched report
Expand Down Expand Up @@ -159,7 +159,7 @@ task :match_identity_with_professional_organization => :environment do
unassigned_identities = Identity.all.where(professional_organization_id: nil)
identities_with_key = unassigned_identities.where(college: key) - @identities_that_need_discussion
identities_with_key.each do |identity_with_key|
identity_with_key.assign_attributes({ professional_organization_id: value, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_with_key.assign_attributes({ professional_organization_id: value, audit_comment: "BY SCRIPT" })
identity_with_key.save
end
end
Expand All @@ -176,7 +176,7 @@ task :match_identity_with_professional_organization => :environment do
# The only institution that matched with Professional Organization Institutions was 'medical_university_of_south_carolina'
# Update Identities and their professional_organization_ids according to 'medical_university_of_south_carolina'
identities_with_key.each do |identity_with_key|
identity_with_key.assign_attributes({ professional_organization_id: 3, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_with_key.assign_attributes({ professional_organization_id: 3, audit_comment: "BY SCRIPT" })
identity_with_key.save
end
puts "END OF INSTITUTION"
Expand All @@ -187,37 +187,37 @@ task :match_identity_with_professional_organization => :environment do

#### WENJUN MANUAL MATCHING ###
if identity_8045 = Identity.find_by(id: 8045)
identity_8045.assign_attributes({ professional_organization_id: 4, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_8045.assign_attributes({ professional_organization_id: 4, audit_comment: "BY SCRIPT" })
identity_8045.save
end

if identity_44254 = Identity.find_by(id: 44254)
identity_44254.assign_attributes({ professional_organization_id: 4, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_44254.assign_attributes({ professional_organization_id: 4, audit_comment: "BY SCRIPT" })
identity_44254.save
end

if identity_46501 = Identity.find_by(id: 46501)
identity_46501.assign_attributes({ professional_organization_id: 16, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_46501.assign_attributes({ professional_organization_id: 16, audit_comment: "BY SCRIPT" })
identity_46501.save
end

if identity_21330 = Identity.find_by(id: 21330)
identity_21330.assign_attributes({ professional_organization_id: 18, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_21330.assign_attributes({ professional_organization_id: 18, audit_comment: "BY SCRIPT" })
identity_21330.save
end

if identity_4958 = Identity.find_by(id: 4958)
identity_4958.assign_attributes({ professional_organization_id: 23, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_4958.assign_attributes({ professional_organization_id: 23, audit_comment: "BY SCRIPT" })
identity_4958.save
end

if identity_23505 = Identity.find_by(id: 23505)
identity_23505.assign_attributes({ professional_organization_id: 23, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_23505.assign_attributes({ professional_organization_id: 23, audit_comment: "BY SCRIPT" })
identity_23505.save
end

if identity_7787 = Identity.find_by(id: 7787)
identity_7787.assign_attributes({ professional_organization_id: 26, audit_comment: "BY SCRIPT" }, without_protection: true)
identity_7787.assign_attributes({ professional_organization_id: 26, audit_comment: "BY SCRIPT" })
identity_7787.save
end
### END WENJUN MANUAL MATCHING ###
Expand All @@ -230,7 +230,7 @@ task :match_identity_with_professional_organization => :environment do

unmatched_identities.each do |unmatched_identity|
identity = Identity.find(unmatched_identity.id)
identity.assign_attributes({ institution: nil, college: nil, department: nil, audit_comment: "BY SCRIPT" }, without_protection: true)
identity.assign_attributes({ institution: nil, college: nil, department: nil, audit_comment: "BY SCRIPT" })
identity.save
end

Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/merge_services.rake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ task :merge_services, [:services_list] => :environment do |t, args|
# ! needed, since only it will return the _other_ attributes.
copy_over_attributes = old_attributes.
slice!(*%w(id ssr_id organization_id org_tree_display status))
dest_ssr.assign_attributes(copy_over_attributes, without_protection: true)
dest_ssr.assign_attributes(copy_over_attributes)
dest_ssr.save(validate: false)
dest_ssr.update_org_tree
ssr.service_request.ensure_ssr_ids
Expand Down

0 comments on commit 5ba725c

Please sign in to comment.