only try to import active outcomes and groups

test plan:
* create an account-level outcome group
* create an outcome in that group, but then delete it
* in a course, find and import the account-level group
* should not import a broken outcome link to the deleted outcome

fixes #CNVS-2015

Change-Id: I59d3404038960e156cd7b3e8540df286f27d1569
Reviewed-on: https://gerrit.instructure.com/34797
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
This commit is contained in:
James Williams 2014-05-13 08:41:17 -06:00
parent 5f927946c5
commit 413e30a4de
1 changed files with 2 additions and 2 deletions

View File

@ -164,12 +164,12 @@ class LearningOutcomeGroup < ActiveRecord::Base
copy.save!
# copy the group contents
original.child_outcome_groups.each do |group|
original.child_outcome_groups.active.each do |group|
next if opts[:only] && opts[:only][group.asset_string] != "1"
copy.add_outcome_group(group, opts)
end
original.child_outcome_links.each do |link|
original.child_outcome_links.active.each do |link|
next if opts[:only] && opts[:only][link.asset_string] != "1"
copy.add_outcome(link.content)
end