Class: Course::Assessment::SkillBranch

Inherits:
ApplicationRecord show all
Defined in:
app/models/course/assessment/skill_branch.rb

Instance Method Summary collapse

Instance Method Details

#initialize_duplicate(duplicator, other) ⇒ Object


7
8
9
10
11
12
# File 'app/models/course/assessment/skill_branch.rb', line 7

def initialize_duplicate(duplicator, other)
  self.course = duplicator.options[:destination_course]
  skills << other.skills.
            select { |skill| duplicator.duplicated?(skill) }.
            map { |skill| duplicator.duplicate(skill) }
end