Class: DefectCopy
Instance Method Summary
collapse
Methods inherited from ObjectCopy
#card_values, #copy, #copy_children, #create_object, #excluded_attributes, #fetch_object, #fetch_project, #find_project_in_new_workspace, #initialize, #logger, #new_workspace, #rally_rest, #remember, #type_as_symbol, #user_exists?
Constructor Details
This class inherits a constructor from ObjectCopy
Instance Method Details
#has_requirement? ⇒ Boolean
49
50
51
|
# File 'lib/translate/copy/defect_copy.rb', line 49
def has_requirement?
not work_product.nil?
end
|
#has_test_case? ⇒ Boolean
45
46
47
|
# File 'lib/translate/copy/defect_copy.rb', line 45
def has_test_case?
not @object.test_case.nil?
end
|
#shallow_copy(object) ⇒ Object
2
3
4
5
6
|
# File 'lib/translate/copy/defect_copy.rb', line 2
def shallow_copy(object)
values = super
values.delete(:submitted_by) unless user_exists? object.submitted_by
values
end
|
#tangle ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/translate/copy/defect_copy.rb', line 8
def tangle
super
if @new_object.nil?
logger.debug "Could not find new object for object #{@object.oid} -- #{@object.name}"
return
end
values = {}
if !@object.requirement.nil?
new_requirement = fetch_object(:artifact, @object.requirement.oid)
values[:requirement] = new_requirement
end
if has_test_case? && has_requirement? && test_cases_work_product != work_product
elsif has_test_case?
new_test_case = fetch_object(:test_case, @object.test_case.oid)
values[:test_case] = new_test_case
end
unless @object.duplicates.nil?
dups = []
@object.duplicates.each do |dup|
dups << fetch_object(:defect, dup.oid)
end
values[:duplicates] = dups
end
@new_object.update(values) unless values.length == 0
end
|
#test_cases_work_product ⇒ Object
53
54
55
56
|
# File 'lib/translate/copy/defect_copy.rb', line 53
def test_cases_work_product
return nil unless has_test_case?
@object.test_case.work_product
end
|
#work_product ⇒ Object
41
42
43
|
# File 'lib/translate/copy/defect_copy.rb', line 41
def work_product
@object.requirement
end
|