-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhirudo_medicinalis.rb
More file actions
46 lines (43 loc) · 1.34 KB
/
hirudo_medicinalis.rb
File metadata and controls
46 lines (43 loc) · 1.34 KB
1
2
3
4
5
6
7
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
40
41
42
43
44
45
46
shared_context 'Hirudo medicinalis' do
before(:all) do
@order = create_cites_eu_order(
taxon_name: create(:taxon_name, scientific_name: 'Arhynchobdellida'),
parent: cites_eu_hirudinoidea
)
@family = create_cites_eu_family(
taxon_name: create(:taxon_name, scientific_name: 'Hirudinidae'),
parent: @order
)
@genus = create_cites_eu_genus(
taxon_name: create(:taxon_name, scientific_name: 'Hirudo'),
parent: @family
)
@species = create_cites_eu_species(
taxon_name: create(:taxon_name, scientific_name: 'Medicinalis'),
parent: @genus,
name_status: 'A'
)
create_cites_II_addition(
taxon_concept: @species,
effective_at: '1987-10-22',
is_current: true
)
create_eu_B_addition(
taxon_concept: @species,
effective_at: '2013-10-08',
event: reg2013,
is_current: true
)
SapiModule::StoredProcedures.rebuild_cites_taxonomy_and_listings
self.instance_variables.each do |t|
# Skip old sapi context let statements,
# which are now instance variables starting with _
next if t.to_s.include?('@_')
var = self.instance_variable_get(t)
if var.kind_of? TaxonConcept
self.instance_variable_set(t, MTaxonConcept.find(var.id))
self.instance_variable_get(t).reload
end
end
end
end