Date: Tue, 6 Oct 2015 09:42:46 +0100
Subject: [PATCH 025/365] fixes #84099622 - populate public note with year of
the event where available
---
.../nomenclature_change/constructor_helpers.rb | 10 ++++++++++
app/models/nomenclature_change/lump/constructor.rb | 5 +++--
app/models/nomenclature_change/split/constructor.rb | 5 +++--
.../status_change/constructor_helpers.rb | 3 ++-
.../nomenclature_change/status_swap/constructor.rb | 1 +
config/locales/nomenclature_change_notes.yml | 13 +++++++------
6 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/app/models/nomenclature_change/constructor_helpers.rb b/app/models/nomenclature_change/constructor_helpers.rb
index f8ec512c71..a55c5def4a 100644
--- a/app/models/nomenclature_change/constructor_helpers.rb
+++ b/app/models/nomenclature_change/constructor_helpers.rb
@@ -196,6 +196,16 @@ def following_taxonomic_changes(event, lng)
end
end
+ def in_year(event, lng)
+ I18n.with_locale(lng) do
+ I18n.translate(
+ 'in_year',
+ year: event && event.effective_at.try(:year) || Date.today.year,
+ default: 'Translation missing'
+ )
+ end
+ end
+
def multi_lingual_legislation_note(note_type)
result = {}
[:en, :es, :fr].each do |lng|
diff --git a/app/models/nomenclature_change/lump/constructor.rb b/app/models/nomenclature_change/lump/constructor.rb
index 0fce2f130a..f195b9014f 100644
--- a/app/models/nomenclature_change/lump/constructor.rb
+++ b/app/models/nomenclature_change/lump/constructor.rb
@@ -59,7 +59,6 @@ def input_lumped_into(input, output, lng)
'lump.input_lumped_into',
input_taxon: input_html,
output_taxon: output_html,
- year: Date.today.year,
default: 'Translation missing'
)
end
@@ -75,7 +74,6 @@ def output_lumped_from(output, inputs, lng)
'lump.output_lumped_from',
output_taxon: output_html,
input_taxa: inputs_html,
- year: Date.today.year,
default: 'Translation missing'
)
end
@@ -86,6 +84,7 @@ def multi_lingual_input_note(input, output, event)
[:en, :es, :fr].each do |lng|
note = ''
note << input_lumped_into(input, output, lng)
+ note << in_year(event, lng)
note << following_taxonomic_changes(event, lng) if event
note << '.
'
result[lng] = note
@@ -98,6 +97,7 @@ def multi_lingual_output_note(output, inputs, event)
[:en, :es, :fr].each do |lng|
note = ''
note << output_lumped_from(output, @nomenclature_change.inputs, lng)
+ note << in_year(event, lng)
note << following_taxonomic_changes(event, lng) if event
note << '.
'
result[lng] = note
@@ -130,6 +130,7 @@ def legislation_note(lng)
output_html = taxon_concept_html(output.display_full_name, output.display_rank_name)
note = ''
note << yield(input_html, output_html)
+ note << in_year(@nomenclature_change.event, lng)
if @nomenclature_change.event
note << following_taxonomic_changes(@nomenclature_change.event, lng)
end
diff --git a/app/models/nomenclature_change/split/constructor.rb b/app/models/nomenclature_change/split/constructor.rb
index d939042723..be3352243d 100644
--- a/app/models/nomenclature_change/split/constructor.rb
+++ b/app/models/nomenclature_change/split/constructor.rb
@@ -89,7 +89,6 @@ def input_split_into(input, outputs, lng)
'split.input_split_into',
output_taxa: outputs_html,
input_taxon: input_html,
- year: Date.today.year,
default: 'Translation missing'
)
end
@@ -115,7 +114,6 @@ def output_split_from(output, input, lng)
'split.output_split_from',
output_taxon: output_html,
input_taxon: input_html,
- year: Date.today.year,
default: 'Translation missing'
)
end
@@ -126,6 +124,7 @@ def multi_lingual_input_note(input, outputs, event)
[:en, :es, :fr].each do |lng|
note = '
'
note << input_split_into(input, @nomenclature_change.outputs, lng)
+ note << in_year(event, lng)
note << following_taxonomic_changes(event, lng) if event
note << '.
'
result[lng] = note
@@ -138,6 +137,7 @@ def multi_lingual_output_note(output, input, event)
[:en, :es, :fr].each do |lng|
note = ''
note << output_split_from(output, input, lng)
+ note << in_year(event, lng)
note << following_taxonomic_changes(event, lng) if event
note << '.
'
result[lng] = note
@@ -170,6 +170,7 @@ def legislation_note(lng)
output_html = taxon_concept_html('[[output]]', input.taxon_concept.rank.name)
note = ''
note << yield(input_html, output_html)
+ note << in_year(@nomenclature_change.event, lng)
if @nomenclature_change.event
note << following_taxonomic_changes(@nomenclature_change.event, lng)
end
diff --git a/app/models/nomenclature_change/status_change/constructor_helpers.rb b/app/models/nomenclature_change/status_change/constructor_helpers.rb
index 01fff8c489..8f0b60fcb6 100644
--- a/app/models/nomenclature_change/status_change/constructor_helpers.rb
+++ b/app/models/nomenclature_change/status_change/constructor_helpers.rb
@@ -85,7 +85,6 @@ def status_change_note(locale_key, output, lng)
output_taxon: output_html,
old_status: output.taxon_concept.name_status,
new_status: output.new_name_status,
- year: Date.today.year,
default: 'Translation missing'
)
end
@@ -110,6 +109,7 @@ def multi_lingual_public_output_note(output, event)
def public_output_note(output, event, lng)
note = '
'
note << status_elevated_to_accepted_name(output, lng)
+ note << in_year(event, lng)
note << following_taxonomic_changes(event, lng) if event
note << '.
'
note
@@ -118,6 +118,7 @@ def public_output_note(output, event, lng)
def private_output_note(output, event, lng)
note = ''
note << status_change_from_to(output, lng)
+ note << in_year(event, lng)
note << following_taxonomic_changes(event, lng) if event
note << '.
'
note
diff --git a/app/models/nomenclature_change/status_swap/constructor.rb b/app/models/nomenclature_change/status_swap/constructor.rb
index 9dc4f5eeae..9cde8d6dbe 100644
--- a/app/models/nomenclature_change/status_swap/constructor.rb
+++ b/app/models/nomenclature_change/status_swap/constructor.rb
@@ -45,6 +45,7 @@ def legislation_note(lng)
input = taxon_concept_html(input.taxon_concept.full_name, input.taxon_concept.rank.name)
note = ''
note << yield(input, output)
+ note << in_year(@event, lng)
if @event
note << following_taxonomic_changes(@event, lng)
end
diff --git a/config/locales/nomenclature_change_notes.yml b/config/locales/nomenclature_change_notes.yml
index ae3ae37535..db3b8be80c 100644
--- a/config/locales/nomenclature_change_notes.yml
+++ b/config/locales/nomenclature_change_notes.yml
@@ -1,22 +1,23 @@
en:
following_taxonomic_changes: ', following taxonomic changes adopted at %{event}'
+ in_year: ' in %{year}'
split:
- output_split_from: '%{output_taxon} was split from %{input_taxon} in %{year}'
- input_split_into: '%{input_taxon} was split into %{output_taxa} in %{year}'
+ output_split_from: '%{output_taxon} was split from %{input_taxon}'
+ input_split_into: '%{input_taxon} was split into %{output_taxa}'
listing_change: 'Originally listed as %{input_taxon}, from which %{output_taxon} was split'
suspension: 'Suspension originally formed for %{input_taxon}, from which %{output_taxon} was split'
opinion: 'Opinion originally formed for %{input_taxon}, from which %{output_taxon} was split'
quota: 'Quota originally published for %{input_taxon}, from which %{output_taxon} was split'
lump:
- input_lumped_into: '%{input_taxon} was lumped into %{output_taxon} in %{year}'
- output_lumped_from: '%{output_taxon} was lumped from %{input_taxa} in %{year}'
+ input_lumped_into: '%{input_taxon} was lumped into %{output_taxon}'
+ output_lumped_from: '%{output_taxon} was lumped from %{input_taxa}'
listing_change: 'Originally listed as %{input_taxon}, which was lumped into %{output_taxon}'
suspension: 'Suspension originally formed for %{input_taxon}, which was lumped into %{output_taxon}'
opinion: 'Opinion originally formed for %{input_taxon}, which was lumped into %{output_taxon}'
quota: 'Quota originally formed for %{input_taxon}, which was lumped into %{output_taxon}'
status_change:
- status_elevated_to_accepted_name: '%{output_taxon} was elevated to an accepted name in %{year}'
- status_change_from_to: '%{output_taxon} status change from %{old_status} to %{new_status} in %{year}'
+ status_elevated_to_accepted_name: '%{output_taxon} was elevated to an accepted name'
+ status_change_from_to: '%{output_taxon} status change from %{old_status} to %{new_status}'
listing_change: 'Originally listed as %{input_taxon}, which became a synonym of %{output_taxon}'
suspension: 'Suspension originally formed for %{input_taxon}, which became a synonym of %{output_taxon}'
opinion: 'Opinion originally formed for %{input_taxon}, which became a synonym of %{output_taxon}'
From 76c5b25ec43a6836555b04e96cde89e69561f21b Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Mon, 5 Oct 2015 17:03:19 +0100
Subject: [PATCH 026/365] possibly fixes legislation reassignments
---
app/models/nomenclature_change/constructor_helpers.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/nomenclature_change/constructor_helpers.rb b/app/models/nomenclature_change/constructor_helpers.rb
index a55c5def4a..9466e2626c 100644
--- a/app/models/nomenclature_change/constructor_helpers.rb
+++ b/app/models/nomenclature_change/constructor_helpers.rb
@@ -121,8 +121,8 @@ def _build_legislation_reassignments(input, outputs)
input.legislation_reassignments.each do |reassignment|
if input.is_a?(NomenclatureChange::Input)
_build_multiple_targets(reassignment, outputs)
- #input.reassignments << reassignment
end
+ input.reassignments << reassignment
end
end
From 5daca61aa786676db1c9390dd9d4828f6b1859cc Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Tue, 6 Oct 2015 15:21:35 +0100
Subject: [PATCH 027/365] Added default text to notes as well as event
selection
---
.../new_name_controller.rb | 9 +++--
.../new_name/constructor.rb | 35 +++++++++++++++++++
.../new_name/name_status.html.erb | 1 +
config/locales/nomenclature_change_notes.yml | 4 ++-
4 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/app/controllers/admin/nomenclature_changes/new_name_controller.rb b/app/controllers/admin/nomenclature_changes/new_name_controller.rb
index 43925fac44..98ad9fd063 100644
--- a/app/controllers/admin/nomenclature_changes/new_name_controller.rb
+++ b/app/controllers/admin/nomenclature_changes/new_name_controller.rb
@@ -8,6 +8,7 @@ def show
builder = NomenclatureChange::NewName::Constructor.new(@nomenclature_change)
case step
when :name_status
+ set_events
builder.build_output
when :parent
set_new_name_taxonomy
@@ -18,6 +19,8 @@ def show
when :hybrid_parents
set_new_name_taxonomy
skip_or_previous_step if @name_status != 'H'
+ when :nomenclature_notes
+ builder.build_output_notes
when :summary
processor = NomenclatureChange::NewName::Processor.new(@nomenclature_change)
@summary = processor.summary
@@ -32,7 +35,11 @@ def update
})
)
+ success = @nomenclature_change.valid?
+
case step
+ when :name_status
+ set_events unless success
when :rank
case @nomenclature_change.output.new_name_status
when 'S' then jump_to(:accepted_names)
@@ -41,8 +48,6 @@ def update
when :parent, :accepted_names, :hybrid_parents
set_new_name_taxonomy
end
-
- success = @nomenclature_change.valid?
render_wizard @nomenclature_change
end
diff --git a/app/models/nomenclature_change/new_name/constructor.rb b/app/models/nomenclature_change/new_name/constructor.rb
index 7c7afbd996..7f0a69954b 100644
--- a/app/models/nomenclature_change/new_name/constructor.rb
+++ b/app/models/nomenclature_change/new_name/constructor.rb
@@ -8,4 +8,39 @@ def initialize(nomenclature_change)
def build_output
@nomenclature_change.build_output if @nomenclature_change.output.nil?
end
+
+ def multi_lingual_output_note(output, event)
+ result = {}
+ [:en, :es, :fr].each do |lng|
+ note = ''
+ note << new_name_note(output, lng)
+ note << following_taxonomic_changes(event, lng) if event
+ note << '.
'
+ result[lng] = note
+ end
+ result
+ end
+
+ def build_output_notes
+ output = @nomenclature_change.output
+ event = @nomenclature_change.event
+ if output.note_en.blank?
+ note = multi_lingual_output_note(output, event)
+ output.note_en = note[:en]
+ output.note_es = note[:es]
+ output.note_fr = note[:fr]
+ end
+ end
+
+ def new_name_note(output, lng)
+ output_html = taxon_concept_html(output.display_full_name, output.display_rank_name)
+ I18n.with_locale(lng) do
+ I18n.translate(
+ 'new_name.new_name_note',
+ output_taxon: output_html,
+ year: Date.current.year,
+ default: 'Translation missing'
+ )
+ end
+ end
end
diff --git a/app/views/admin/nomenclature_changes/new_name/name_status.html.erb b/app/views/admin/nomenclature_changes/new_name/name_status.html.erb
index 3745cccc8a..4466b59c48 100644
--- a/app/views/admin/nomenclature_changes/new_name/name_status.html.erb
+++ b/app/views/admin/nomenclature_changes/new_name/name_status.html.erb
@@ -4,6 +4,7 @@
Assign name status
<%= nomenclature_change_form do |f| %>
+ <%= render 'admin/nomenclature_changes/build/event_selector', :f => f %>
<%= f.fields_for :output do |ff| %>
Select name status
diff --git a/config/locales/nomenclature_change_notes.yml b/config/locales/nomenclature_change_notes.yml
index db3b8be80c..10a9a5e2c0 100644
--- a/config/locales/nomenclature_change_notes.yml
+++ b/config/locales/nomenclature_change_notes.yml
@@ -1,6 +1,8 @@
en:
following_taxonomic_changes: ', following taxonomic changes adopted at %{event}'
in_year: ' in %{year}'
+ new_name:
+ new_name_note: '%{output_taxon} was added to the database in %{year}'
split:
output_split_from: '%{output_taxon} was split from %{input_taxon}'
input_split_into: '%{input_taxon} was split into %{output_taxa}'
@@ -21,4 +23,4 @@ en:
listing_change: 'Originally listed as %{input_taxon}, which became a synonym of %{output_taxon}'
suspension: 'Suspension originally formed for %{input_taxon}, which became a synonym of %{output_taxon}'
opinion: 'Opinion originally formed for %{input_taxon}, which became a synonym of %{output_taxon}'
- quota: 'Quota originally published for %{input_taxon}, which became a synonym of %{output_taxon}'
\ No newline at end of file
+ quota: 'Quota originally published for %{input_taxon}, which became a synonym of %{output_taxon}'
From 3f1dbb67d4b00970042ec5c774b0f80be3a09d98 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Tue, 6 Oct 2015 16:59:35 +0100
Subject: [PATCH 028/365] Added tags to nomenclature_notes step for new name
wizard
---
.../nomenclature_changes/new_name_controller.rb | 5 +++++
app/helpers/admin_helper.rb | 2 +-
app/models/nomenclature_change/output.rb | 12 +++++++++++-
.../new_name/nomenclature_notes.html.erb | 16 +++++++++++++---
...dd_tag_list_to_nomenclature_changes_output.rb | 5 +++++
5 files changed, 35 insertions(+), 5 deletions(-)
create mode 100644 db/migrate/20151006153403_add_tag_list_to_nomenclature_changes_output.rb
diff --git a/app/controllers/admin/nomenclature_changes/new_name_controller.rb b/app/controllers/admin/nomenclature_changes/new_name_controller.rb
index 98ad9fd063..f1e41fd95f 100644
--- a/app/controllers/admin/nomenclature_changes/new_name_controller.rb
+++ b/app/controllers/admin/nomenclature_changes/new_name_controller.rb
@@ -21,6 +21,7 @@ def show
skip_or_previous_step if @name_status != 'H'
when :nomenclature_notes
builder.build_output_notes
+ load_tags
when :summary
processor = NomenclatureChange::NewName::Processor.new(@nomenclature_change)
@summary = processor.summary
@@ -84,4 +85,8 @@ def skip_or_previous_step
end
end
+ def load_tags
+ @tags = PresetTag.where(:model => PresetTag::TYPES[:TaxonConcept])
+ end
+
end
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
index b6963c4cea..fd073b54e0 100644
--- a/app/helpers/admin_helper.rb
+++ b/app/helpers/admin_helper.rb
@@ -70,7 +70,7 @@ def true_false_icon(bool_value)
end
def tag_list(tags_ary)
- tags_ary.map{ |t| content_tag(:span, :class => 'myMinTag'){t} }.join.html_safe
+ tags_ary.map{ |t| content_tag(:span, :class => 'myMinTag'){t} }.join(', ').html_safe
end
def error_messages_for(resource)
diff --git a/app/models/nomenclature_change/output.rb b/app/models/nomenclature_change/output.rb
index 86408be157..767ff07331 100644
--- a/app/models/nomenclature_change/output.rb
+++ b/app/models/nomenclature_change/output.rb
@@ -38,7 +38,8 @@ class NomenclatureChange::Output < ActiveRecord::Base
:new_name_status, :new_parent_id, :new_rank_id, :taxonomy_id, :accepted_taxon_ids,
:note_en, :note_es, :note_fr, :internal_note, :is_primary_output,
:parent_reassignments_attributes, :name_reassignments_attributes,
- :distribution_reassignments_attributes, :legislation_reassignments_attributes, :hybrid_parent_id, :other_hybrid_parent_id
+ :distribution_reassignments_attributes, :legislation_reassignments_attributes, :hybrid_parent_id, :other_hybrid_parent_id, :tag_list
+
belongs_to :nomenclature_change
belongs_to :taxon_concept
belongs_to :parent, :class_name => TaxonConcept, :foreign_key => :parent_id
@@ -89,6 +90,14 @@ def accepted_taxon_ids=(ary)
write_attribute(:accepted_taxon_ids, "{#{ary && ary.join(',')}}")
end
+ def tag_list
+ parse_pg_array(read_attribute(:tag_list)||"").compact
+ end
+
+ def tag_list=(ary)
+ write_attribute(:tag_list, "{#{ary && ary.join(',')}}")
+ end
+
def fetch_accepted_taxons_full_name
if accepted_taxon_ids.present?
ActiveRecord::Base.connection.execute(
@@ -158,6 +167,7 @@ def tmp_taxon_concept
taxon_concept_attrs.merge({
:taxonomy_id => taxonomy.id,
:full_name => display_full_name,
+ :tag_list => tag_list
})
).tap do |tc|
add_taxon_synonym(tc, accepted_taxon_ids)
diff --git a/app/views/admin/nomenclature_changes/new_name/nomenclature_notes.html.erb b/app/views/admin/nomenclature_changes/new_name/nomenclature_notes.html.erb
index eccd2314d4..631b16b740 100644
--- a/app/views/admin/nomenclature_changes/new_name/nomenclature_notes.html.erb
+++ b/app/views/admin/nomenclature_changes/new_name/nomenclature_notes.html.erb
@@ -2,11 +2,21 @@
<%= nomenclature_change_form do |f| %>
<%= f.fields_for :output do |ff| %>
+
Tags
- <%= render partial: 'admin/nomenclature_changes/build/nomenclature_notes',
- locals: {ff: ff}
+ <%= ff.select :tag_list,
+ options_from_collection_for_select(
+ @tags,
+ :name,
+ :name,
+ ff.object.tag_list
+ ), {},
+ { :multiple => true, :class => 'tags', :style => "width: 220px"}
%>
+
-
+ <%= render partial: 'admin/nomenclature_changes/build/nomenclature_notes',
+ locals: {ff: ff}
+ %>
<% end %>
<% end %>
diff --git a/db/migrate/20151006153403_add_tag_list_to_nomenclature_changes_output.rb b/db/migrate/20151006153403_add_tag_list_to_nomenclature_changes_output.rb
new file mode 100644
index 0000000000..34ddf51578
--- /dev/null
+++ b/db/migrate/20151006153403_add_tag_list_to_nomenclature_changes_output.rb
@@ -0,0 +1,5 @@
+class AddTagListToNomenclatureChangesOutput < ActiveRecord::Migration
+ def change
+ add_column :nomenclature_change_outputs, :tag_list, :text, array: true, default: []
+ end
+end
From 1729310e37ab6f44dda1aabd2792cee52bfb2057 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Tue, 6 Oct 2015 17:07:59 +0100
Subject: [PATCH 029/365] Fixed smoke tests when deploying
---
lib/capistrano/tasks/smoke_test.rake | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/capistrano/tasks/smoke_test.rake b/lib/capistrano/tasks/smoke_test.rake
index add151972d..d1f76bd19e 100644
--- a/lib/capistrano/tasks/smoke_test.rake
+++ b/lib/capistrano/tasks/smoke_test.rake
@@ -1,3 +1,5 @@
+require 'net/http'
+
namespace :smoke_test do
task :test_endpoints do
From 643097baf3cb77c94f1014baad5d5e898cd320b5 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 8 Oct 2015 09:12:46 +0100
Subject: [PATCH 030/365] fix exception when no author_year present (A->S)
---
app/helpers/admin/nomenclature_changes_helper.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/helpers/admin/nomenclature_changes_helper.rb b/app/helpers/admin/nomenclature_changes_helper.rb
index 3a02e77a1c..1096167a60 100644
--- a/app/helpers/admin/nomenclature_changes_helper.rb
+++ b/app/helpers/admin/nomenclature_changes_helper.rb
@@ -288,13 +288,14 @@ def outputs_content
end
def inner_content(input_or_output,tc)
+ is_output = input_or_output.is_a?(NomenclatureChange::Output)
content_tag(:p, content_tag(:i, link_to(tc.full_name,
admin_taxon_concept_names_path(tc)), nil)
) +
- if input_or_output.is_a?(NomenclatureChange::Output)
+ if is_output
content_tag(:p, "Name status: #{input_or_output.new_name_status || input_or_output.name_status}")
end +
- content_tag(:p, "Author: #{tc.author_year || tc.new_author_year}") +
+ content_tag(:p, "Author: #{tc.author_year || is_output && input_or_output.new_author_year}") +
content_tag(:p, "Internal note: #{input_or_output.internal_note}")
end
From c2c4910dafb4e03dddeb72185b76eba66900b1ed Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 8 Oct 2015 11:19:31 +0100
Subject: [PATCH 031/365] changed deploy branch
---
config/deploy/staging.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb
index 34f27b87da..8923725796 100644
--- a/config/deploy/staging.rb
+++ b/config/deploy/staging.rb
@@ -1,5 +1,5 @@
set :stage, :staging
-set :branch, "master"
+set :branch, "nomenclature_changes"
server "sapi-staging.linode.unep-wcmc.org", user: "wcmc", roles: %w{app web db}
From 1bd4a734db57df0757f3a679fdf9183c452c03ff Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Thu, 8 Oct 2015 16:10:32 +0100
Subject: [PATCH 032/365] If note is nil then use empty string as default
---
app/models/m_taxon_concept.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/m_taxon_concept.rb b/app/models/m_taxon_concept.rb
index 31f4a58749..02dc524f33 100644
--- a/app/models/m_taxon_concept.rb
+++ b/app/models/m_taxon_concept.rb
@@ -244,7 +244,7 @@ def recently_changed
["hash_full_note_#{lng.downcase}", "full_note_#{lng.downcase}", "short_note_#{lng.downcase}"].each do |method_name|
define_method(method_name) do
current_cites_additions.map do |lc|
- note = lc.send(method_name)
+ note = lc.send(method_name) || ''
note && "Appendix #{lc.species_listing_name}:" + (note || '') + (" #{lc.nomenclature_note}" || '')
end.join("\n")
end
From 72736cef59ef28eda607377ce34341de3f8562bb Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Thu, 8 Oct 2015 23:42:42 +0100
Subject: [PATCH 033/365] Replace joins with includes to fix readonly exception
---
app/models/listing_change.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/listing_change.rb b/app/models/listing_change.rb
index be2d651be3..e444a943d9 100644
--- a/app/models/listing_change.rb
+++ b/app/models/listing_change.rb
@@ -137,14 +137,14 @@ def duplicates(comparison_attributes_override = {})
)
)
if party_listing_distribution
- relation = relation.joins(:party_listing_distribution).where(
+ relation = relation.includes(:party_listing_distribution).where(
party_listing_distribution.comparison_conditions(
party_listing_distribution.comparison_attributes.except(:listing_change_id)
)
)
end
if annotation
- relation = relation.joins(:annotation).where(
+ relation = relation.includes(:annotation).where(
annotation.comparison_conditions
)
end
From c816cf18c399d776bbc9e1f6a4f32e0d2eb7044d Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Sun, 11 Oct 2015 18:17:38 +0100
Subject: [PATCH 034/365] Name changes cascade if rank in range of
Genus-Variety
---
.../admin/taxon_concepts_controller.rb | 5 ++++
app/models/taxon_concept.rb | 7 ++++++
app/workers/update_taxonomy_worker.rb | 25 +++++++++++++++++++
3 files changed, 37 insertions(+)
create mode 100644 app/workers/update_taxonomy_worker.rb
diff --git a/app/controllers/admin/taxon_concepts_controller.rb b/app/controllers/admin/taxon_concepts_controller.rb
index efb1323587..a04392ae63 100644
--- a/app/controllers/admin/taxon_concepts_controller.rb
+++ b/app/controllers/admin/taxon_concepts_controller.rb
@@ -48,8 +48,12 @@ def create
end
def update
+ @taxon_concept = TaxonConcept.find(params[:id])
+ rebuild_taxonomy =
+ @taxon_concept.rebuild_taxonomy?(params[:taxon_concept][:full_name])
update! do |success, failure|
success.js {
+ UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
render 'update'
}
failure.js {
@@ -59,6 +63,7 @@ def update
render 'new'
}
success.html {
+ UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
redirect_to edit_admin_taxon_concept_url(@taxon_concept),
:notice => 'Operation successful'
}
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 1fc483a45f..17fec10732 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -327,6 +327,12 @@ def expected_full_name(parent)
end
end
+ def rebuild_taxonomy?(new_full_name)
+ new_full_name and new_full_name != full_name and
+ Rank.in_range(Rank::VARIETY, Rank::GENUS).include?(rank.name)
+ end
+
+
private
def dependent_objects_map
@@ -506,4 +512,5 @@ def ensure_taxonomic_position
true
end
+
end
diff --git a/app/workers/update_taxonomy_worker.rb b/app/workers/update_taxonomy_worker.rb
new file mode 100644
index 0000000000..32d1ae2dd5
--- /dev/null
+++ b/app/workers/update_taxonomy_worker.rb
@@ -0,0 +1,25 @@
+class UpdateTaxonomyWorker
+ include Sidekiq::Worker
+
+ def perform
+ puts "Procedure: taxonomy"
+ ActiveRecord::Base.connection.execute(
+ "SELECT * FROM rebuild_taxonomy()"
+ )
+
+ changed_cnt = TaxonConcept.where('touched_at IS NOT NULL AND touched_at > updated_at').count
+
+ if changed_cnt > 0
+ # increment cache iterators if anything changed
+ Species::Search.increment_cache_iterator
+ Species::TaxonConceptPrefixMatcher.increment_cache_iterator
+ Checklist::Checklist.increment_cache_iterator
+
+ TaxonConcept.update_all(
+ 'updated_at = touched_at',
+ 'touched_at IS NOT NULL AND touched_at > updated_at'
+ )
+ end
+
+ end
+end
From 68d55231412ce183c4004ad24847b8a3c89ec296 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Mon, 12 Oct 2015 10:45:02 +0100
Subject: [PATCH 035/365] Improve rebuild_taxonomy code
---
app/controllers/admin/taxon_concepts_controller.rb | 2 +-
app/models/taxon_concept.rb | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/controllers/admin/taxon_concepts_controller.rb b/app/controllers/admin/taxon_concepts_controller.rb
index a04392ae63..29db859fa6 100644
--- a/app/controllers/admin/taxon_concepts_controller.rb
+++ b/app/controllers/admin/taxon_concepts_controller.rb
@@ -50,7 +50,7 @@ def create
def update
@taxon_concept = TaxonConcept.find(params[:id])
rebuild_taxonomy =
- @taxon_concept.rebuild_taxonomy?(params[:taxon_concept][:full_name])
+ @taxon_concept.rebuild_taxonomy?(params)
update! do |success, failure|
success.js {
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 17fec10732..90327e2d83 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -327,7 +327,8 @@ def expected_full_name(parent)
end
end
- def rebuild_taxonomy?(new_full_name)
+ def rebuild_taxonomy?(params)
+ new_full_name = params[:taxon_concept] ? params[:taxon_concept][:full_name] : ''
new_full_name and new_full_name != full_name and
Rank.in_range(Rank::VARIETY, Rank::GENUS).include?(rank.name)
end
From dbed76cac8fc2326a1ab5a5851b227d5d0085976 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Mon, 12 Oct 2015 12:36:50 +0100
Subject: [PATCH 036/365] Moved init function into superclass to be used by all
its subclasses
---
.../admin/admin_in_place_editor.js.coffee | 80 +++++++++----------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/app/assets/javascripts/admin/admin_in_place_editor.js.coffee b/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
index 8a8ddc2383..2880d855a4 100644
--- a/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
+++ b/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
@@ -47,6 +47,46 @@ class AdminEditor
$(alert).insertBefore($('h1'))
+ initTaxonConceptTypeaheads: () ->
+
+ $('input.typeahead').each (idx) ->
+ formId = $(@).closest('form').attr('id')
+
+ if formId?
+ matches = formId.match('^(.+_)?(new|edit)_(.+)$')
+ prefix = matches[3]
+ prefix = matches[1] + prefix unless matches[1] == undefined
+
+ taxonomyEl = $('#' + prefix + '_taxonomy_id')
+ rankEl = $('#' + prefix + '_rank_id')
+
+ #initialize this typeahead
+ $(@).typeahead
+ source: (query, process) =>
+ $.get('/admin/taxon_concepts/autocomplete',
+ {
+ search_params: {
+ scientific_name: query,
+ taxonomy: {
+ id: taxonomyEl && taxonomyEl.val() || $(@).attr('data-taxonomy-id')
+ },
+ rank: {
+ id: rankEl && rankEl.val() || $(@).attr('data-rank-id'),
+ scope: $(@).attr('data-rank-scope')
+ }
+ }
+ limit: 25
+ }, (data) =>
+ labels = []
+ $.each(data, (i, item) =>
+ label = item.full_name + ' ' + item.rank_name
+ labels.push(label)
+ )
+ return process(labels)
+ )
+ $().add(taxonomyEl).add(rankEl).change () =>
+ $(@).val(null)
+
initSearchTypeahead: () ->
$('.search-typeahead').typeahead
source: (query, process) ->
@@ -168,46 +208,6 @@ class TaxonConceptsEditor extends AdminEditor
@initTaxonConceptTypeaheads()
$('.distributions-list > a').popover({});
- initTaxonConceptTypeaheads: () ->
-
- $('input.typeahead').each (idx) ->
- formId = $(@).closest('form').attr('id')
-
- if formId?
- matches = formId.match('^(.+_)?(new|edit)_(.+)$')
- prefix = matches[3]
- prefix = matches[1] + prefix unless matches[1] == undefined
-
- taxonomyEl = $('#' + prefix + '_taxonomy_id')
- rankEl = $('#' + prefix + '_rank_id')
-
- #initialize this typeahead
- $(@).typeahead
- source: (query, process) =>
- $.get('/admin/taxon_concepts/autocomplete',
- {
- search_params: {
- scientific_name: query,
- taxonomy: {
- id: taxonomyEl && taxonomyEl.val() || $(@).attr('data-taxonomy-id')
- },
- rank: {
- id: rankEl && rankEl.val() || $(@).attr('data-rank-id'),
- scope: $(@).attr('data-rank-scope')
- }
- }
- limit: 25
- }, (data) =>
- labels = []
- $.each(data, (i, item) =>
- label = item.full_name + ' ' + item.rank_name
- labels.push(label)
- )
- return process(labels)
- )
- $().add(taxonomyEl).add(rankEl).change () =>
- $(@).val(null)
-
alertSuccess: (txt) ->
$('.alert').remove()
From f6b8cf50b0759cdea3a8d336e8cbedbe7633ae97 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Mon, 12 Oct 2015 14:02:18 +0100
Subject: [PATCH 037/365] Fix split's interface outputs ordering
---
app/assets/stylesheets/admin/layout.scss | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/app/assets/stylesheets/admin/layout.scss b/app/assets/stylesheets/admin/layout.scss
index 39cb29b6ab..aa95b261b1 100644
--- a/app/assets/stylesheets/admin/layout.scss
+++ b/app/assets/stylesheets/admin/layout.scss
@@ -73,19 +73,15 @@ form.documents {
width: 50%;
}
-ol {
+form ol {
counter-reset: listCounter;
list-style-type: none;
-}
-
-ol li {
- counter-increment: listCounter;
-}
-
-ol li:before {
- content: "Taxon " counter(listCounter) ".";
+ .fields > li { counter-increment: listCounter; }
+ .fields > li:before {
+ content: "Taxon " counter(listCounter) ".";
+ }
}
.new-scientific-name-eg {
display: inline-block;
-}
\ No newline at end of file
+}
From da59a09f8688c732e0334cf7a273058c8738c082 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 14:22:29 +0100
Subject: [PATCH 038/365] fixed transfer of distribution references
---
.../reassignment_transfer_processor.rb | 42 +++++++++++++++++++
...bution_reassignments_processor_examples.rb | 8 +++-
2 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/app/models/nomenclature_change/reassignment_transfer_processor.rb b/app/models/nomenclature_change/reassignment_transfer_processor.rb
index 39374951fa..c72d0b9c03 100644
--- a/app/models/nomenclature_change/reassignment_transfer_processor.rb
+++ b/app/models/nomenclature_change/reassignment_transfer_processor.rb
@@ -6,6 +6,7 @@ def process_reassignment(reassignment, reassignable)
if reassigned_object
reassigned_object.save(validate: false)
post_process(reassigned_object, object_before_reassignment)
+ transfer_associations(reassigned_object, reassignable)
end
reassigned_object
end
@@ -48,4 +49,45 @@ def summary_line
to #{@output.display_full_name}"
end
+ protected
+
+ def transfer_associations(reassigned_object, reassignable)
+ return if reassigned_object.id == reassignable.id
+ if reassigned_object.is_a?(Distribution)
+ # that means the distribution is a duplicate and was not transferred
+ # but it might have some distribution references and taggings
+ transfer_distribution_references(reassigned_object, reassignable)
+ transfer_distribution_taggings(reassigned_object, reassignable)
+ end
+ # destroy the original object
+ reassignable.delete
+ end
+
+ def transfer_distribution_references(reassigned_object, reassignable)
+ return if reassignable.distribution_references.count == 0
+ distribution_references_to_transfer = reassignable.distribution_references
+ if reassigned_object.distribution_references.count > 0
+ distribution_references_to_transfer = distribution_references_to_transfer.
+ where(
+ 'reference_id NOT IN (?)',
+ reassigned_object.distribution_references.select(:reference_id)
+ .map(&:reference_id)
+ )
+ end
+ distribution_references_to_transfer.update_all(distribution_id: reassigned_object.id)
+ end
+
+ def transfer_distribution_taggings(reassigned_object, reassignable)
+ return if reassignable.taggings.count == 0
+ taggings_to_transfer = reassignable.taggings
+ if reassigned_object.taggings.count > 0
+ taggings_to_transfer = taggings_to_transfer.
+ where(
+ 'tag_id NOT IN (?)',
+ reassigned_object.taggings.select(:tag_id).map(&:tag_id)
+ )
+ end
+ taggings_to_transfer.update_all(taggable_id: reassigned_object.id)
+ end
+
end
diff --git a/spec/models/nomenclature_change/shared/distribution_reassignments_processor_examples.rb b/spec/models/nomenclature_change/shared/distribution_reassignments_processor_examples.rb
index 920e0d06b0..fa7ac4e14e 100644
--- a/spec/models/nomenclature_change/shared/distribution_reassignments_processor_examples.rb
+++ b/spec/models/nomenclature_change/shared/distribution_reassignments_processor_examples.rb
@@ -19,6 +19,12 @@
)
}
before(:each) do
+ original_d = create(
+ :distribution,
+ taxon_concept: output_species1,
+ geo_entity: poland
+ )
+ original_d.distribution_references.create(reference_id: create(:reference).id)
create(:preset_tag, model: 'Distribution', name: 'extinct')
d = create(
:distribution,
@@ -33,5 +39,5 @@
specify{ expect(output_species1.distributions.count).to eq(2) }
specify{ expect(output_species1.distributions.find_by_geo_entity_id(poland.id)).not_to be_nil }
specify{ expect(output_species1.distributions.find_by_geo_entity_id(poland.id).tag_list).to eq(['extinct']) }
- specify{ expect(output_species1.distributions.find_by_geo_entity_id(poland.id).distribution_references.count).to eq(1) }
+ specify{ expect(output_species1.distributions.find_by_geo_entity_id(poland.id).distribution_references.count).to eq(2) }
end
From fe695dc778c5d753cbae8ce2af1c284c6bf03c59 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 14:24:46 +0100
Subject: [PATCH 039/365] fixed typo in debug output
---
app/models/nomenclature_change/reassignment_processor.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/nomenclature_change/reassignment_processor.rb b/app/models/nomenclature_change/reassignment_processor.rb
index 6c7554a83c..1562aea902 100644
--- a/app/models/nomenclature_change/reassignment_processor.rb
+++ b/app/models/nomenclature_change/reassignment_processor.rb
@@ -85,7 +85,7 @@ def conflicting_listing_change_reassignment?(reassignment, reassignable)
end
def post_process(reassigned_object, object_before_reassignment)
- Rails.logger.warn("Resassignment post processing BEGIN")
+ Rails.logger.warn("Reassignment post processing BEGIN")
if reassigned_object.is_a?(TaxonConcept)
resolver = NomenclatureChange::TaxonomicTreeNameResolver.new(reassigned_object)
resolver.process
@@ -93,7 +93,7 @@ def post_process(reassigned_object, object_before_reassignment)
resolver = NomenclatureChange::TradeShipmentsResolver.new(reassigned_object, object_before_reassignment)
resolver.process
end
- Rails.logger.warn("Resassignment post processing END")
+ Rails.logger.warn("Reassignment post processing END")
end
end
From bf5fba0b29eaa3b92e5fdd1c4d8ac820f7be7de1 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 22:24:46 +0100
Subject: [PATCH 040/365] ensure dependencies are destroyed
---
.../reassignment_transfer_processor.rb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/models/nomenclature_change/reassignment_transfer_processor.rb b/app/models/nomenclature_change/reassignment_transfer_processor.rb
index c72d0b9c03..ac90a8c4ad 100644
--- a/app/models/nomenclature_change/reassignment_transfer_processor.rb
+++ b/app/models/nomenclature_change/reassignment_transfer_processor.rb
@@ -59,8 +59,14 @@ def transfer_associations(reassigned_object, reassignable)
transfer_distribution_references(reassigned_object, reassignable)
transfer_distribution_taggings(reassigned_object, reassignable)
end
+ if reassigned_object.is_a?(ListingChange)
+ transfer_party_listing_distribution(reassigned_object, reassignable)
+ transfer_listing_distributions(reassigned_object, reassignable)
+ transfer_taxonomic_exclusions(reassigned_object, reassignable)
+ transfer_geographic_exclusions(reassigned_object, reassignable)
+ end
# destroy the original object
- reassignable.delete
+ reassignable.destroy
end
def transfer_distribution_references(reassigned_object, reassignable)
From 6add68c81ac98a37fbc691e2dfc070f19a000783 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 22:25:13 +0100
Subject: [PATCH 041/365] fixed transfer of listing distributions
---
.../reassignment_transfer_processor.rb | 40 +++++++++++++++++++
...lation_reassignments_processor_examples.rb | 21 +++++++++-
2 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/app/models/nomenclature_change/reassignment_transfer_processor.rb b/app/models/nomenclature_change/reassignment_transfer_processor.rb
index ac90a8c4ad..53fc4786bb 100644
--- a/app/models/nomenclature_change/reassignment_transfer_processor.rb
+++ b/app/models/nomenclature_change/reassignment_transfer_processor.rb
@@ -96,4 +96,44 @@ def transfer_distribution_taggings(reassigned_object, reassignable)
taggings_to_transfer.update_all(taggable_id: reassigned_object.id)
end
+ def transfer_party_listing_distribution(reassigned_object, reassignable)
+ return if reassigned_object.party_listing_distribution
+ return if !reassignable.party_listing_distribution
+ reassignable.party_listing_distribution.update_attribute(:listing_change_id, reassigned_object.id)
+ end
+
+ def transfer_listing_distributions(reassigned_object, reassignable)
+ return if reassignable.listing_distributions.count == 0
+ listing_distributions_to_transfer = reassignable.listing_distributions
+
+ if reassigned_object.listing_distributions.count > 0
+ listing_distributions_to_transfer = listing_distributions_to_transfer.
+ where(
+ 'geo_entity_id NOT IN (?)',
+ reassigned_object.listing_distributions.select(:geo_entity_id)
+ .map(&:geo_entity_id)
+ )
+ end
+ listing_distributions_to_transfer.update_all(listing_change_id: reassigned_object.id)
+ end
+
+
+ def transfer_taxonomic_exclusions(reassigned_object, reassignable)
+ return if reassignable.taxonomic_exclusions.count == 0
+ taxonomic_exclusions_to_transfer = reassignable.taxonomic_exclusions
+ if reassigned_object.taxonomic_exclusions.count > 0
+ taxonomic_exclusions_to_transfer = taxonomic_exclusions_to_transfer.
+ where(
+ 'taxon_concept_id NOT IN (?)',
+ reassigned_object.taxonomic_exclusions.select(:taxon_concept_id).
+ map(&:taxon_concept_id)
+ )
+ end
+ taxonomic_exclusions_to_transfer.update_all(parent_id: reassigned_object.id)
+ end
+
+ def transfer_geographic_exclusions(reassigned_object, reassignable)
+ reassignable.geographic_exclusions.update_all(parent_id: reassigned_object.id)
+ end
+
end
diff --git a/spec/models/nomenclature_change/shared/legislation_reassignments_processor_examples.rb b/spec/models/nomenclature_change/shared/legislation_reassignments_processor_examples.rb
index a6aed65b1d..4cbad93acc 100644
--- a/spec/models/nomenclature_change/shared/legislation_reassignments_processor_examples.rb
+++ b/spec/models/nomenclature_change/shared/legislation_reassignments_processor_examples.rb
@@ -15,6 +15,23 @@
}
before(:each) do
lc1_annotation = create(:annotation)
+ original_lc1 = create_cites_III_addition(
+ taxon_concept: output_species1,
+ annotation: lc1_annotation,
+ effective_at: '2013-01-01'
+ )
+ create(
+ :listing_distribution,
+ geo_entity: poland,
+ listing_change: original_lc1,
+ is_party: true
+ )
+ create(
+ :listing_distribution,
+ geo_entity: portugal,
+ listing_change: original_lc1,
+ is_party: false
+ )
lc1 = create_cites_III_addition(
taxon_concept: input_species,
annotation: lc1_annotation,
@@ -99,8 +116,8 @@
expect(
output_species1.listing_changes.
find_by_effective_at_and_change_type_id('2013-01-01', cites_addition.id).
- listing_distributions
- ).to_not be_empty
+ listing_distributions.count
+ ).to eq(2)
}
specify{
expect(
From b22316b83be3948e9eb2dacf6f023c7f0c439a07 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 22:38:59 +0100
Subject: [PATCH 042/365] clear downloads cache after processing
---
app/models/nomenclature_change/processor.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/models/nomenclature_change/processor.rb b/app/models/nomenclature_change/processor.rb
index b967dece97..a0899d926b 100644
--- a/app/models/nomenclature_change/processor.rb
+++ b/app/models/nomenclature_change/processor.rb
@@ -11,6 +11,7 @@ def run
Rails.logger.warn("[#{@nc.type}] BEGIN")
@subprocessors.each{ |processor| processor.run }
Rails.logger.warn("[#{@nc.type}] END")
+ DownloadsCache.clear
end
def summary
From fdab5d18e95b4cb960aa89fd57ff3cd7bffea71a Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Mon, 12 Oct 2015 15:00:43 +0100
Subject: [PATCH 043/365] removed unused taxon concept create action
---
.../admin/taxon_concepts_controller.rb | 16 ----------------
config/routes.rb | 2 +-
.../admin/taxon_concepts_controller_spec.rb | 13 -------------
3 files changed, 1 insertion(+), 30 deletions(-)
diff --git a/app/controllers/admin/taxon_concepts_controller.rb b/app/controllers/admin/taxon_concepts_controller.rb
index 29db859fa6..9a4ca5b665 100644
--- a/app/controllers/admin/taxon_concepts_controller.rb
+++ b/app/controllers/admin/taxon_concepts_controller.rb
@@ -31,22 +31,6 @@ def edit
end
end
- def create
- create! do |success, failure|
- @taxonomies = Taxonomy.order(:name)
- @ranks = Rank.order(:taxonomic_position)
- success.js { render('create') }
- failure.js {
- if @taxon_concept.is_synonym?
- @synonym = @taxon_concept
- render('new_synonym')
- else
- render('new')
- end
- }
- end
- end
-
def update
@taxon_concept = TaxonConcept.find(params[:id])
rebuild_taxonomy =
diff --git a/config/routes.rb b/config/routes.rb
index 19e644bfe5..c5fba8855d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -118,7 +118,7 @@
resources :ahoy_visits, :only => [:index, :show]
resources :ahoy_events, :only => [:index, :show]
- resources :taxon_concepts do
+ resources :taxon_concepts, only: [:index, :edit, :update, :show, :destroy] do
get :autocomplete, :on => :collection
resources :children, :only => [:index]
resources :taxon_relationships, :only => [:index, :create, :destroy]
diff --git a/spec/controllers/admin/taxon_concepts_controller_spec.rb b/spec/controllers/admin/taxon_concepts_controller_spec.rb
index 962f38078e..bfc8a03805 100644
--- a/spec/controllers/admin/taxon_concepts_controller_spec.rb
+++ b/spec/controllers/admin/taxon_concepts_controller_spec.rb
@@ -33,19 +33,6 @@
end
end
- describe "XHR POST create" do
- let(:taxon_concept_attributes){ build_tc_attributes(:taxon_concept) }
- it "renders create when successful" do
- xhr :post, :create,
- taxon_concept: taxon_concept_attributes
- response.should render_template("create")
- end
- it "renders new when not successful" do
- xhr :post, :create, taxon_concept: {}
- response.should render_template("new")
- end
- end
-
describe "XHR PUT update" do
let(:taxon_concept){ create(:taxon_concept) }
context "when JSON" do
From 61d68a8ebaa432706177eb7120662a2fd4b67c58 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Mon, 12 Oct 2015 16:57:08 +0100
Subject: [PATCH 044/365] removed unused new synonym form (the "not nested"
one, formerly available on the home page)
---
app/helpers/taxon_concept_helper.rb | 8 ++---
app/views/admin/names/index.html.erb | 2 +-
.../taxon_concepts/_synonym_form.html.erb | 34 -------------------
.../admin/taxon_concepts/new_synonym.js.erb | 4 ---
4 files changed, 5 insertions(+), 43 deletions(-)
delete mode 100644 app/views/admin/taxon_concepts/_synonym_form.html.erb
delete mode 100644 app/views/admin/taxon_concepts/new_synonym.js.erb
diff --git a/app/helpers/taxon_concept_helper.rb b/app/helpers/taxon_concept_helper.rb
index e93e12c574..7d8168f6c3 100644
--- a/app/helpers/taxon_concept_helper.rb
+++ b/app/helpers/taxon_concept_helper.rb
@@ -45,11 +45,11 @@ def admin_add_new_hybrid_button
)
end
- def admin_new_synonym_modal(nested = false)
+ def admin_new_synonym_modal
admin_new_modal(
- :resource => 'taxon_concept_synonym',
- :title => 'Add new Synonym'
- ){ nested ? '' : render('synonym_form') }
+ resource: 'taxon_concept_synonym',
+ title: 'Add new Synonym'
+ ){ '' }
end
def admin_new_trade_name_modal(nested = false)
diff --git a/app/views/admin/names/index.html.erb b/app/views/admin/names/index.html.erb
index 8036c68d9d..14b7311672 100644
--- a/app/views/admin/names/index.html.erb
+++ b/app/views/admin/names/index.html.erb
@@ -3,7 +3,7 @@
Synonyms
<%= admin_add_new_synonym_button %>
- <%= admin_new_synonym_modal(true) %>
+ <%= admin_new_synonym_modal %>
<% if @taxon_concept.has_synonyms? %>
diff --git a/app/views/admin/taxon_concepts/_synonym_form.html.erb b/app/views/admin/taxon_concepts/_synonym_form.html.erb
deleted file mode 100644
index 743d744acd..0000000000
--- a/app/views/admin/taxon_concepts/_synonym_form.html.erb
+++ /dev/null
@@ -1,34 +0,0 @@
-<%= form_for [:admin, @synonym], :remote => true, :namespace => 'synonym' do |f| %>
- <%= error_messages_for(@synonym) %>
- <%= f.hidden_field :name_status %>
-
-
- Taxonomy
- <%= f.select :taxonomy_id,
- options_from_collection_for_select(
- @taxonomies, :id, :name, @synonym && @synonym.taxonomy_id
- )
- %>
-
-
- Rank
- <%= f.select :rank_id,
- options_from_collection_for_select(
- @ranks, :id, :name,
- @synonym && @synonym.rank_id
- )
- %>
-
-
- Accepted name
- <%= f.text_field :accepted_scientific_name, :class => 'typeahead' %>
-
-
- Synonym
- <%= f.text_field :full_name %>
-
-
- Author & year
- <%= f.text_field :author_year %>
-
-<% end %>
diff --git a/app/views/admin/taxon_concepts/new_synonym.js.erb b/app/views/admin/taxon_concepts/new_synonym.js.erb
deleted file mode 100644
index e85a9b24c3..0000000000
--- a/app/views/admin/taxon_concepts/new_synonym.js.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-$('#admin-new-taxon_concept_synonym-form').html(
- "<%= escape_javascript(render('synonym_form')) %>");
-$('#new-taxon_concept_synonym').modal('show');
-window.adminEditor.initTaxonConceptTypeaheads();
\ No newline at end of file
From 6875359243839064884270a5d702846dd1d2947a Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Mon, 12 Oct 2015 17:15:53 +0100
Subject: [PATCH 045/365] changed the new synonym modal to allow selecting an
existing synonym
---
.../admin/nomenclature_changes.js.coffee | 8 ++---
.../synonym_relationships/_form.html.erb | 35 ++++++++-----------
.../admin/synonym_relationships/new.js.erb | 1 +
3 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/app/assets/javascripts/admin/nomenclature_changes.js.coffee b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
index 0a8ce9f2d0..9470027d46 100644
--- a/app/assets/javascripts/admin/nomenclature_changes.js.coffee
+++ b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
@@ -1,5 +1,5 @@
$(document).ready ->
- defaultTaxonSelect2Options = {
+ window.defaultTaxonSelect2Options = {
placeholder: 'Start typing scientific name'
width: '300px'
minimumInputLength: 3
@@ -43,8 +43,8 @@ $(document).ready ->
callback(result)
}
- $('.taxon-concept').select2(defaultTaxonSelect2Options)
- $('.taxon-concept-multiple').select2($.extend(defaultTaxonSelect2Options,multiTaxonSelect2Options))
+ $('.taxon-concept').select2(window.defaultTaxonSelect2Options)
+ $('.taxon-concept-multiple').select2($.extend(window.defaultTaxonSelect2Options,multiTaxonSelect2Options))
$('.taxon-concept').on('change', (event) ->
return false unless event.val
$.when($.ajax( '/admin/taxon_concepts/' + event.val + '.json' ) ).then(( data, textStatus, jqXHR ) =>
@@ -82,7 +82,7 @@ $(document).ready ->
# it's a jQuery object already
taxonField = field.find('.taxon-concept')
# and activate select2
- taxonField.select2(defaultTaxonSelect2Options)
+ taxonField.select2(window.defaultTaxonSelect2Options)
)
simpleTaxonSelect2Options = {
diff --git a/app/views/admin/synonym_relationships/_form.html.erb b/app/views/admin/synonym_relationships/_form.html.erb
index 23540c0336..67bfbf7570 100644
--- a/app/views/admin/synonym_relationships/_form.html.erb
+++ b/app/views/admin/synonym_relationships/_form.html.erb
@@ -6,26 +6,19 @@
<%= form_for [:admin, @taxon_concept, @synonym_relationship], :url => form_url, :remote => true do |f| %>
<%= error_messages_for(@synonym_relationship) %>
<%= f.hidden_field :taxon_relationship_type_id %>
- <%= f.fields_for :other_taxon_concept do |ff| %>
- <%= ff.hidden_field :name_status %>
- <%= ff.hidden_field :taxonomy_id %>
-
-
Rank
- <%= ff.select :rank_id,
- options_from_collection_for_select(
- @ranks, :id, :name,
- @synonym_relationship && @synonym_relationship.other_taxon_concept &&
- @synonym_relationship.other_taxon_concept.rank_id
- )
- %>
+
+
Select existing synonym:
+
+ <%= f.text_field :other_taxon_concept_id, {
+ :class => 'taxon-concept clear-others',
+ :'data-name' => @synonym_relationship.other_taxon_concept.try(:full_name),
+ :'data-name-status' => @synonym_relationship.other_taxon_concept.try(:name_status),
+ :'data-name-status-filter' => ['S'],
+ :'data-taxonomy-id' => @taxon_concept.taxonomy_id
+ } %>
-
- Synonym
- <%= ff.text_field :full_name %>
-
-
- Author & year
- <%= ff.text_field :author_year %>
-
- <% end %>
+
+
+ <%= link_to 'Create a new synonym', admin_nomenclature_changes_path %>
+
<% end %>
diff --git a/app/views/admin/synonym_relationships/new.js.erb b/app/views/admin/synonym_relationships/new.js.erb
index f8f76fdbeb..8443208178 100644
--- a/app/views/admin/synonym_relationships/new.js.erb
+++ b/app/views/admin/synonym_relationships/new.js.erb
@@ -1,2 +1,3 @@
$('#admin-new-taxon_concept_synonym-form').html("<%= escape_javascript(render('form')) %>");
$('#new-taxon_concept_synonym').modal('show');
+$('.taxon-concept').select2(window.defaultTaxonSelect2Options);
From 9f98ff012844205c501c3486cd69484167e3eddb Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Mon, 12 Oct 2015 17:23:11 +0100
Subject: [PATCH 046/365] changed the new trade name modal to allow selecting
an existing synonym
---
app/helpers/taxon_concept_helper.rb | 4 +--
app/views/admin/names/index.html.erb | 2 +-
.../trade_name_relationships/_form.html.erb | 32 +++++++------------
.../admin/trade_name_relationships/new.js.erb | 1 +
4 files changed, 15 insertions(+), 24 deletions(-)
diff --git a/app/helpers/taxon_concept_helper.rb b/app/helpers/taxon_concept_helper.rb
index 7d8168f6c3..2175b4c3ba 100644
--- a/app/helpers/taxon_concept_helper.rb
+++ b/app/helpers/taxon_concept_helper.rb
@@ -52,11 +52,11 @@ def admin_new_synonym_modal
){ '' }
end
- def admin_new_trade_name_modal(nested = false)
+ def admin_new_trade_name_modal
admin_new_modal(
:resource => 'taxon_concept_trade_name',
:title => 'Add new Trade name'
- ){ nested ? '' : render('trade_name_form') }
+ ){ '' }
end
def admin_add_new_distribution_button
diff --git a/app/views/admin/names/index.html.erb b/app/views/admin/names/index.html.erb
index 14b7311672..ef3f92df42 100644
--- a/app/views/admin/names/index.html.erb
+++ b/app/views/admin/names/index.html.erb
@@ -16,7 +16,7 @@
Trade names
<%= admin_add_new_trade_name_button %>
- <%= admin_new_trade_name_modal(true) %>
+ <%= admin_new_trade_name_modal %>
<% if @taxon_concept.has_trade_names? %>
diff --git a/app/views/admin/trade_name_relationships/_form.html.erb b/app/views/admin/trade_name_relationships/_form.html.erb
index f63bbf6de5..7b34e9e9ca 100644
--- a/app/views/admin/trade_name_relationships/_form.html.erb
+++ b/app/views/admin/trade_name_relationships/_form.html.erb
@@ -6,26 +6,16 @@
<%= form_for [:admin, @taxon_concept, @trade_name_relationship], :url => form_url, :remote => true do |f| %>
<%= error_messages_for(@trade_name_relationship) %>
<%= f.hidden_field :taxon_relationship_type_id %>
- <%= f.fields_for :other_taxon_concept do |ff| %>
- <%= ff.hidden_field :name_status %>
- <%= ff.hidden_field :taxonomy_id %>
-
-
Rank
- <%= ff.select :rank_id,
- options_from_collection_for_select(
- @ranks, :id, :name,
- @trade_name_relationship && @trade_name_relationship.other_taxon_concept &&
- @trade_name_relationship.other_taxon_concept.rank_id
- )
- %>
+
+
Select existing trade name:
+
+ <%= f.text_field :other_taxon_concept_id, {
+ :class => 'taxon-concept clear-others',
+ :'data-name' => @trade_name_relationship.other_taxon_concept.try(:full_name),
+ :'data-name-status' => @trade_name_relationship.other_taxon_concept.try(:name_status),
+ :'data-name-status-filter' => ['T'],
+ :'data-taxonomy-id' => @taxon_concept.taxonomy_id
+ } %>
-
- Trade name
- <%= ff.text_field :full_name %>
-
-
- Author & year
- <%= ff.text_field :author_year %>
-
- <% end %>
+
<% end %>
diff --git a/app/views/admin/trade_name_relationships/new.js.erb b/app/views/admin/trade_name_relationships/new.js.erb
index b412d99195..45bf14bc96 100644
--- a/app/views/admin/trade_name_relationships/new.js.erb
+++ b/app/views/admin/trade_name_relationships/new.js.erb
@@ -1,2 +1,3 @@
$('#admin-new-taxon_concept_trade_name-form').html("<%= escape_javascript(render('form')) %>");
$('#new-taxon_concept_trade_name').modal('show');
+$('.taxon-concept').select2(window.defaultTaxonSelect2Options);
From f41caa5b024a1e3f7d6b434a79c0e05a7ab250a1 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Tue, 13 Oct 2015 11:39:14 +0100
Subject: [PATCH 047/365] removed potentially obsolete script
---
app/views/admin/taxon_concepts/create_synonym.js.erb | 4 ----
1 file changed, 4 deletions(-)
delete mode 100644 app/views/admin/taxon_concepts/create_synonym.js.erb
diff --git a/app/views/admin/taxon_concepts/create_synonym.js.erb b/app/views/admin/taxon_concepts/create_synonym.js.erb
deleted file mode 100644
index 5fceb22b04..0000000000
--- a/app/views/admin/taxon_concepts/create_synonym.js.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-$('.modal').modal('hide');
-$('#synonyms-list').html("<%= escape_javascript(render('synonym_list')) %>");
-window.adminEditor.initEditors();
-window.adminEditor.alertSuccess("Operation successful");
From 6362ab06a0a6375a822d5baeabe69a7b920685ea Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Tue, 13 Oct 2015 11:41:28 +0100
Subject: [PATCH 048/365] fixes edit modal windows for synonyms & trade names
---
app/assets/javascripts/admin/nomenclature_changes.js.coffee | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/assets/javascripts/admin/nomenclature_changes.js.coffee b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
index 9470027d46..111a0b6658 100644
--- a/app/assets/javascripts/admin/nomenclature_changes.js.coffee
+++ b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
@@ -44,7 +44,7 @@ $(document).ready ->
}
$('.taxon-concept').select2(window.defaultTaxonSelect2Options)
- $('.taxon-concept-multiple').select2($.extend(window.defaultTaxonSelect2Options,multiTaxonSelect2Options))
+ $('.taxon-concept-multiple').select2($.extend({}, window.defaultTaxonSelect2Options, multiTaxonSelect2Options))
$('.taxon-concept').on('change', (event) ->
return false unless event.val
$.when($.ajax( '/admin/taxon_concepts/' + event.val + '.json' ) ).then(( data, textStatus, jqXHR ) =>
From d8417ac500d502b4c7d38e5e88bfc46f3d5f5b77 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Tue, 13 Oct 2015 11:44:43 +0100
Subject: [PATCH 049/365] changed the new hybrid modal to allow selecting an
existing hybrid
---
app/helpers/taxon_concept_helper.rb | 4 +-
.../admin/hybrid_relationships/_form.html.erb | 54 +++++--------------
.../admin/hybrid_relationships/new.js.erb | 9 +---
app/views/admin/names/index.html.erb | 2 +-
.../taxon_concepts/_hybrid_form.html.erb | 54 -------------------
.../admin/taxon_concepts/new_hybrid.js.erb | 4 --
6 files changed, 19 insertions(+), 108 deletions(-)
delete mode 100644 app/views/admin/taxon_concepts/_hybrid_form.html.erb
delete mode 100644 app/views/admin/taxon_concepts/new_hybrid.js.erb
diff --git a/app/helpers/taxon_concept_helper.rb b/app/helpers/taxon_concept_helper.rb
index 2175b4c3ba..656809cdd6 100644
--- a/app/helpers/taxon_concept_helper.rb
+++ b/app/helpers/taxon_concept_helper.rb
@@ -96,11 +96,11 @@ def admin_edit_distribution_modal(nested = false)
){ nested ? '' : render('admin/distributions/form') }
end
- def admin_new_hybrid_modal(nested = false)
+ def admin_new_hybrid_modal
admin_new_modal(
:resource => 'taxon_concept_hybrid',
:title => 'Add new Hybrid'
- ){ nested ? '' : render('hybrid_form') }
+ ){ '' }
end
def admin_add_new_reference_button
diff --git a/app/views/admin/hybrid_relationships/_form.html.erb b/app/views/admin/hybrid_relationships/_form.html.erb
index 7acaa6f1a6..5664fb494d 100644
--- a/app/views/admin/hybrid_relationships/_form.html.erb
+++ b/app/views/admin/hybrid_relationships/_form.html.erb
@@ -6,45 +6,19 @@
<%= form_for [:admin, @taxon_concept, @hybrid_relationship], :url => form_url, :remote => true do |f| %>
<%= error_messages_for(@hybrid_relationship) %>
<%= f.hidden_field :taxon_relationship_type_id %>
- <%= f.fields_for :other_taxon_concept do |ff| %>
- <%= ff.hidden_field :name_status %>
- <%= ff.hidden_field :taxonomy_id %>
-
-
Rank
- <%= ff.select :rank_id,
- options_from_collection_for_select(
- @ranks, :id, :name,
- @hybrid_relationship && @hybrid_relationship.other_taxon_concept &&
- @hybrid_relationship.other_taxon_concept.rank_id
- )
- %>
+
+
Select existing hybrid:
+
+ <%= f.text_field :other_taxon_concept_id, {
+ :class => 'taxon-concept',
+ :'data-name' => @hybrid_relationship.other_taxon_concept.try(:full_name),
+ :'data-name-status' => @hybrid_relationship.other_taxon_concept.try(:name_status),
+ :'data-name-status-filter' => ['H'],
+ :'data-taxonomy-id' => @taxon_concept.taxonomy_id
+ } %>
-
- Other hybrid parent name
- <%= ff.text_field :other_hybrid_parent_scientific_name,
- :class => 'typeahead', "data-rank-scope" => 'ancestors',
- "data-taxonomy-id" => @taxon_concept.taxonomy_id
- %>
-
-
- Hybrid
- <%= ff.text_field :full_name %>
-
-
- Tags
- <%= ff.select :tag_list,
- options_from_collection_for_select(
- @tags,
- :name,
- :name,
- @taxon_concept.tag_list
- ), {},
- { :multiple => true, :class => 'tags', :style => "width: 220px"}
- %>
-
-
- Author & year
- <%= ff.text_field :author_year %>
-
- <% end %>
+
+
+ <%= link_to 'Create a new hybrid', admin_nomenclature_changes_path %>
+
<% end %>
diff --git a/app/views/admin/hybrid_relationships/new.js.erb b/app/views/admin/hybrid_relationships/new.js.erb
index 3a10e2da7c..f7bf1a9dd7 100644
--- a/app/views/admin/hybrid_relationships/new.js.erb
+++ b/app/views/admin/hybrid_relationships/new.js.erb
@@ -1,8 +1,3 @@
-// $().html is asynchronous, inexplicably, so we render the form to a jQuery object
-// first and init the tag box before passing to .html()
-var form = $("<%= escape_javascript(render('form')) %>");
-form.find('.tags').select2();
-
-$('#admin-new-taxon_concept_hybrid-form').html(form);
+$('#admin-new-taxon_concept_hybrid-form').html("<%= escape_javascript(render('form')) %>");
$('#new-taxon_concept_hybrid').modal('show');
-window.adminEditor.initTaxonConceptTypeaheads();
+$('.taxon-concept').select2(window.defaultTaxonSelect2Options);
diff --git a/app/views/admin/names/index.html.erb b/app/views/admin/names/index.html.erb
index ef3f92df42..393c22adf5 100644
--- a/app/views/admin/names/index.html.erb
+++ b/app/views/admin/names/index.html.erb
@@ -43,7 +43,7 @@
Hybrids
<%= admin_add_new_hybrid_button %>
- <%= admin_new_hybrid_modal(true) %>
+ <%= admin_new_hybrid_modal %>
<% if @taxon_concept.has_hybrids? %>
diff --git a/app/views/admin/taxon_concepts/_hybrid_form.html.erb b/app/views/admin/taxon_concepts/_hybrid_form.html.erb
deleted file mode 100644
index d2e632e01a..0000000000
--- a/app/views/admin/taxon_concepts/_hybrid_form.html.erb
+++ /dev/null
@@ -1,54 +0,0 @@
-<%= form_for [:admin, @hybrid], :remote => true, :namespace => 'hybrid' do |f| %>
- <%= error_messages_for(@hybrid) %>
- <%= f.hidden_field :name_status %>
-
-
- Taxonomy
- <%= f.select :taxonomy_id,
- options_from_collection_for_select(
- @taxonomies, :id, :name, @hybrid && @hybrid.taxonomy_id
- )
- %>
-
-
- Rank
- <%= f.select :rank_id,
- options_from_collection_for_select(
- @ranks, :id, :name,
- @hybrid && @hybrid.rank_id
- )
- %>
-
-
- Hybrid parent name
- <%= f.text_field :hybrid_parent_scientific_name, :class => 'typeahead',
- "data-rank-scope" => 'ancestors'
- %>
-
-
- Other hybrid parent name
- <%= f.text_field :other_hybrid_parent_scientific_name, :class => 'typeahead',
- "data-rank-scope" => 'ancestors'
- %>
-
-
- Hybrid
- <%= f.text_field :full_name %>
-
-
- Tags
- <%= f.select :tag_list,
- options_from_collection_for_select(
- @tags,
- :name,
- :name,
- @taxon_concept.tag_list
- ), {},
- { :multiple => true, :class => 'tags', :style => "width: 220px"}
- %>
-
-
- Author & year
- <%= f.text_field :author_year %>
-
-<% end %>
diff --git a/app/views/admin/taxon_concepts/new_hybrid.js.erb b/app/views/admin/taxon_concepts/new_hybrid.js.erb
deleted file mode 100644
index feff054727..0000000000
--- a/app/views/admin/taxon_concepts/new_hybrid.js.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-$('#admin-new-taxon_concept_hybrid-form').html(
- "<%= escape_javascript(render('hybrid_form')) %>");
-$('#new-taxon_concept_hybrid').modal('show');
-window.adminEditor.initTaxonConceptTypeaheads();
\ No newline at end of file
From 19aaa353c92e80e1ea36b4dc260f06581947bb98 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Tue, 13 Oct 2015 12:56:02 +0100
Subject: [PATCH 050/365] removed obsolete initialisation
---
app/views/admin/hybrid_relationships/create.js.erb | 1 -
app/views/admin/synonym_relationships/create.js.erb | 1 -
app/views/admin/trade_name_relationships/create.js.erb | 1 -
3 files changed, 3 deletions(-)
diff --git a/app/views/admin/hybrid_relationships/create.js.erb b/app/views/admin/hybrid_relationships/create.js.erb
index fc0d86f0ba..ccb7f0f7ce 100644
--- a/app/views/admin/hybrid_relationships/create.js.erb
+++ b/app/views/admin/hybrid_relationships/create.js.erb
@@ -1,4 +1,3 @@
$('.modal').modal('hide');
$('#hybrids-list').html("<%= escape_javascript(render('list')) %>");
-window.adminEditor.initEditors();
window.adminEditor.alertSuccess("Operation successful");
diff --git a/app/views/admin/synonym_relationships/create.js.erb b/app/views/admin/synonym_relationships/create.js.erb
index a4cc901a56..96b64a99b9 100644
--- a/app/views/admin/synonym_relationships/create.js.erb
+++ b/app/views/admin/synonym_relationships/create.js.erb
@@ -1,4 +1,3 @@
$('.modal').modal('hide');
$('#synonyms-list').html("<%= escape_javascript(render('list')) %>");
-window.adminEditor.initEditors();
window.adminEditor.alertSuccess("Operation successful");
diff --git a/app/views/admin/trade_name_relationships/create.js.erb b/app/views/admin/trade_name_relationships/create.js.erb
index 0450c11c48..2cea289101 100644
--- a/app/views/admin/trade_name_relationships/create.js.erb
+++ b/app/views/admin/trade_name_relationships/create.js.erb
@@ -1,4 +1,3 @@
$('.modal').modal('hide');
$('#trade_names-list').html("<%= escape_javascript(render('list')) %>");
-window.adminEditor.initEditors();
window.adminEditor.alertSuccess("Operation successful");
From 4471882515177574dd5b50a0571fa4c9db959289 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Tue, 13 Oct 2015 12:56:36 +0100
Subject: [PATCH 051/365] removed obsolete class name
---
app/views/admin/synonym_relationships/_form.html.erb | 2 +-
app/views/admin/trade_name_relationships/_form.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/admin/synonym_relationships/_form.html.erb b/app/views/admin/synonym_relationships/_form.html.erb
index 67bfbf7570..fea36ebd02 100644
--- a/app/views/admin/synonym_relationships/_form.html.erb
+++ b/app/views/admin/synonym_relationships/_form.html.erb
@@ -10,7 +10,7 @@
Select existing synonym:
<%= f.text_field :other_taxon_concept_id, {
- :class => 'taxon-concept clear-others',
+ :class => 'taxon-concept',
:'data-name' => @synonym_relationship.other_taxon_concept.try(:full_name),
:'data-name-status' => @synonym_relationship.other_taxon_concept.try(:name_status),
:'data-name-status-filter' => ['S'],
diff --git a/app/views/admin/trade_name_relationships/_form.html.erb b/app/views/admin/trade_name_relationships/_form.html.erb
index 7b34e9e9ca..98e2740779 100644
--- a/app/views/admin/trade_name_relationships/_form.html.erb
+++ b/app/views/admin/trade_name_relationships/_form.html.erb
@@ -10,7 +10,7 @@
Select existing trade name:
<%= f.text_field :other_taxon_concept_id, {
- :class => 'taxon-concept clear-others',
+ :class => 'taxon-concept',
:'data-name' => @trade_name_relationship.other_taxon_concept.try(:full_name),
:'data-name-status' => @trade_name_relationship.other_taxon_concept.try(:name_status),
:'data-name-status-filter' => ['T'],
From 368b747bf91afbb01104b932ff7fb35bd5f56330 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Tue, 13 Oct 2015 14:24:21 +0100
Subject: [PATCH 052/365] removed obsolete loading code
---
.../admin/hybrid_relationships_controller.rb | 15 ------------
.../admin/synonym_relationships_controller.rb | 24 -------------------
.../trade_name_relationships_controller.rb | 24 -------------------
3 files changed, 63 deletions(-)
diff --git a/app/controllers/admin/hybrid_relationships_controller.rb b/app/controllers/admin/hybrid_relationships_controller.rb
index 183ab30cb2..32b62d3d0e 100644
--- a/app/controllers/admin/hybrid_relationships_controller.rb
+++ b/app/controllers/admin/hybrid_relationships_controller.rb
@@ -7,19 +7,10 @@ class Admin::HybridRelationshipsController < Admin::TaxonConceptAssociatedTypesC
authorize_resource :class => false
def new
- @taxonomies = Taxonomy.order(:name)
- @ranks = Rank.order(:taxonomic_position)
- @tags = TaxonConcept.tag_counts_on('tags')
new! do |format|
@hybrid_relationship = TaxonRelationship.new(
:taxon_relationship_type_id => @hybrid_relationship_type.id
)
- @hybrid_relationship.build_other_taxon_concept(
- :taxonomy_id => @taxon_concept.taxonomy_id,
- :rank_id => @taxon_concept.rank_id,
- :name_status => 'H'
- )
- @hybrid_relationship.other_taxon_concept.build_taxon_name
end
end
@@ -33,18 +24,12 @@ def create
render 'create'
}
failure.js {
- @taxonomies = Taxonomy.order(:name)
- @ranks = Rank.order(:taxonomic_position)
- @tags = TaxonConcept.tag_counts_on('tags')
render 'new'
}
end
end
def edit
- @taxonomies = Taxonomy.order(:name)
- @ranks = Rank.order(:taxonomic_position)
- @tags = TaxonConcept.tag_counts_on('tags')
edit! do |format|
format.js { render 'new' }
end
diff --git a/app/controllers/admin/synonym_relationships_controller.rb b/app/controllers/admin/synonym_relationships_controller.rb
index 9a57d8a5bc..584e2ef024 100644
--- a/app/controllers/admin/synonym_relationships_controller.rb
+++ b/app/controllers/admin/synonym_relationships_controller.rb
@@ -6,16 +6,9 @@ class Admin::SynonymRelationshipsController < Admin::TaxonConceptAssociatedTypes
def new
new! do |format|
- load_taxonomies_and_ranks
@synonym_relationship = TaxonRelationship.new(
:taxon_relationship_type_id => @synonym_relationship_type.id
)
- @synonym_relationship.build_other_taxon_concept(
- :taxonomy_id => @taxon_concept.taxonomy_id,
- :rank_id => @taxon_concept.rank_id,
- :name_status => 'S'
- )
- @synonym_relationship.other_taxon_concept.build_taxon_name
end
end
@@ -29,16 +22,6 @@ def create
render 'create'
}
failure.js {
- @synonym_relationship.build_other_taxon_concept(
- :taxonomy_id => @taxon_concept.taxonomy_id,
- :rank_id => @taxon_concept.rank_id,
- :name_status => 'S',
- :full_name => params[:taxon_relationship][:other_taxon_concept_attributes][:full_name],
- :author_year => params[:taxon_relationship][:other_taxon_concept_attributes][:author_year]
-
- )
- @synonym_relationship.other_taxon_concept.build_taxon_name
- load_taxonomies_and_ranks
render 'new'
}
end
@@ -46,7 +29,6 @@ def create
def edit
edit! do |format|
- load_taxonomies_and_ranks
format.js { render 'new' }
end
end
@@ -61,7 +43,6 @@ def update
render 'create'
}
failure.js {
- load_taxonomies_and_ranks
render 'new'
}
end
@@ -77,11 +58,6 @@ def destroy
protected
- def load_taxonomies_and_ranks
- @taxonomies = Taxonomy.order(:name)
- @ranks = Rank.order(:taxonomic_position)
- end
-
def load_synonym_relationship_type
@synonym_relationship_type = TaxonRelationshipType.
find_by_name(TaxonRelationshipType::HAS_SYNONYM)
diff --git a/app/controllers/admin/trade_name_relationships_controller.rb b/app/controllers/admin/trade_name_relationships_controller.rb
index c5c056cd8c..ca4b918182 100644
--- a/app/controllers/admin/trade_name_relationships_controller.rb
+++ b/app/controllers/admin/trade_name_relationships_controller.rb
@@ -6,16 +6,9 @@ class Admin::TradeNameRelationshipsController < Admin::TaxonConceptAssociatedTyp
def new
new! do |format|
- load_taxonomies_and_ranks
@trade_name_relationship = TaxonRelationship.new(
:taxon_relationship_type_id => @trade_name_relationship_type.id
)
- @trade_name_relationship.build_other_taxon_concept(
- :taxonomy_id => @taxon_concept.taxonomy_id,
- :rank_id => @taxon_concept.rank_id,
- :name_status => 'T'
- )
- @trade_name_relationship.other_taxon_concept.build_taxon_name
end
end
@@ -29,16 +22,6 @@ def create
render 'create'
}
failure.js {
- @trade_name_relationship.build_other_taxon_concept(
- :taxonomy_id => @taxon_concept.taxonomy_id,
- :rank_id => @taxon_concept.rank_id,
- :name_status => 'T',
- :full_name => params[:taxon_relationship][:other_taxon_concept_attributes][:full_name],
- :author_year => params[:taxon_relationship][:other_taxon_concept_attributes][:author_year]
-
- )
- @trade_name_relationship.other_taxon_concept.build_taxon_name
- load_taxonomies_and_ranks
render 'new'
}
end
@@ -46,7 +29,6 @@ def create
def edit
edit! do |format|
- load_taxonomies_and_ranks
format.js { render 'new' }
end
end
@@ -61,7 +43,6 @@ def update
render 'create'
}
failure.js {
- load_taxonomies_and_ranks
render 'new'
}
end
@@ -77,11 +58,6 @@ def destroy
protected
- def load_taxonomies_and_ranks
- @taxonomies = Taxonomy.order(:name)
- @ranks = Rank.order(:taxonomic_position)
- end
-
def load_trade_name_relationship_type
@trade_name_relationship_type = TaxonRelationshipType.
find_by_name(TaxonRelationshipType::HAS_TRADE_NAME)
From ca8ff61b77fcd531bb4429abd421f7effd921e8f Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Tue, 13 Oct 2015 14:25:12 +0100
Subject: [PATCH 053/365] added inverse relationships with input for
reassignment subclasses
---
app/models/nomenclature_change/distribution_reassignment.rb | 3 +++
app/models/nomenclature_change/legislation_reassignment.rb | 3 +++
app/models/nomenclature_change/name_reassignment.rb | 3 +++
app/models/nomenclature_change/parent_reassignment.rb | 3 +++
4 files changed, 12 insertions(+)
diff --git a/app/models/nomenclature_change/distribution_reassignment.rb b/app/models/nomenclature_change/distribution_reassignment.rb
index ba00e4914f..734e02269c 100644
--- a/app/models/nomenclature_change/distribution_reassignment.rb
+++ b/app/models/nomenclature_change/distribution_reassignment.rb
@@ -19,4 +19,7 @@
# Reassignable is a distribution that is assigned to a new taxon concept
class NomenclatureChange::DistributionReassignment < NomenclatureChange::Reassignment
+ belongs_to :input, class_name: NomenclatureChange::Input,
+ inverse_of: :distribution_reassignments,
+ foreign_key: :nomenclature_change_input_id
end
diff --git a/app/models/nomenclature_change/legislation_reassignment.rb b/app/models/nomenclature_change/legislation_reassignment.rb
index 2dde0ca608..4aa71b049b 100644
--- a/app/models/nomenclature_change/legislation_reassignment.rb
+++ b/app/models/nomenclature_change/legislation_reassignment.rb
@@ -19,4 +19,7 @@
# Reassignable is legislation that is assigned to a new taxon concept
class NomenclatureChange::LegislationReassignment < NomenclatureChange::Reassignment
+ belongs_to :input, class_name: NomenclatureChange::Input,
+ inverse_of: :legislation_reassignments,
+ foreign_key: :nomenclature_change_input_id
end
diff --git a/app/models/nomenclature_change/name_reassignment.rb b/app/models/nomenclature_change/name_reassignment.rb
index 14b7ff878e..1eea7e8a51 100644
--- a/app/models/nomenclature_change/name_reassignment.rb
+++ b/app/models/nomenclature_change/name_reassignment.rb
@@ -19,4 +19,7 @@
# Reassignable is a taxon relationship that is assigned to a new taxon concept
class NomenclatureChange::NameReassignment < NomenclatureChange::Reassignment
+ belongs_to :input, class_name: NomenclatureChange::Input,
+ inverse_of: :name_reassignments,
+ foreign_key: :nomenclature_change_input_id
end
diff --git a/app/models/nomenclature_change/parent_reassignment.rb b/app/models/nomenclature_change/parent_reassignment.rb
index 37536f5a1c..5ba0a43180 100644
--- a/app/models/nomenclature_change/parent_reassignment.rb
+++ b/app/models/nomenclature_change/parent_reassignment.rb
@@ -23,5 +23,8 @@ class NomenclatureChange::ParentReassignment < NomenclatureChange::Reassignment
has_one :reassignment_target, :inverse_of => :reassignment,
:class_name => NomenclatureChange::ReassignmentTarget,
:foreign_key => :nomenclature_change_reassignment_id
+ belongs_to :input, class_name: NomenclatureChange::Input,
+ inverse_of: :parent_reassignments,
+ foreign_key: :nomenclature_change_input_id
accepts_nested_attributes_for :reassignment_target, :allow_destroy => true
end
From 4850b95551445cbaf6e8607c419e389f45a08b6e Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Wed, 14 Oct 2015 11:24:32 +0100
Subject: [PATCH 054/365] removed the ability to create S, H, T taxa via nested
attributes in TaxonRelationship
---
app/models/taxon_relationship.rb | 8 ++-
.../hybrid_relationships_controller_spec.rb | 10 ++-
.../synonym_relationships_controller_spec.rb | 10 ++-
...ade_names_relationships_controller_spec.rb | 10 ++-
spec/models/hybrid_relationship_spec.rb | 61 ++++++-------------
spec/models/synonym_relationship_spec.rb | 58 ++++++------------
spec/models/taxon_concept/hybrids_spec.rb | 39 +++++-------
spec/models/taxon_concept/synonyms_spec.rb | 43 +++++--------
spec/models/taxon_concept/trade_names_spec.rb | 43 +++++--------
9 files changed, 95 insertions(+), 187 deletions(-)
diff --git a/app/models/taxon_relationship.rb b/app/models/taxon_relationship.rb
index 8cf789ece0..c09b8e6226 100644
--- a/app/models/taxon_relationship.rb
+++ b/app/models/taxon_relationship.rb
@@ -29,11 +29,13 @@ class TaxonRelationship < ActiveRecord::Base
before_destroy :destroy_opposite, :if => Proc.new { self.is_bidirectional? && self.has_opposite? }
after_create :create_opposite, :if => Proc.new { self.is_bidirectional? && !self.has_opposite? }
after_save :update_higher_taxa_for_hybrid_child
- validates :taxon_concept_id, :uniqueness => { :scope => [:taxon_relationship_type_id, :other_taxon_concept_id], :message => 'This relationship already exists, choose another taxa.' }
+ validates :taxon_concept_id, uniqueness: {
+ scope: [:taxon_relationship_type_id, :other_taxon_concept_id],
+ message: 'This relationship already exists, choose another taxon.'
+ }
+ validates :other_taxon_concept_id, presence: true
validate :intertaxonomic_relationship_uniqueness, :if => "taxon_relationship_type.is_intertaxonomic?"
- accepts_nested_attributes_for :other_taxon_concept
-
def update_higher_taxa_for_hybrid_child
if other_taxon_concept && taxon_relationship_type &&
taxon_relationship_type.name == TaxonRelationshipType::HAS_HYBRID
diff --git a/spec/controllers/admin/hybrid_relationships_controller_spec.rb b/spec/controllers/admin/hybrid_relationships_controller_spec.rb
index 1ab39f704a..f74a564fed 100644
--- a/spec/controllers/admin/hybrid_relationships_controller_spec.rb
+++ b/spec/controllers/admin/hybrid_relationships_controller_spec.rb
@@ -29,8 +29,7 @@
xhr :post, :create,
:taxon_concept_id => taxon_concept.id,
:taxon_relationship => {
- :other_taxon_concept_attributes =>
- build_tc_attributes(:taxon_concept, :name_status => 'H')
+ other_taxon_concept_id: hybrid.id
}
response.should render_template("create")
end
@@ -38,7 +37,7 @@
xhr :post, :create,
:taxon_concept_id => taxon_concept.id,
:taxon_relationship => {
- :other_taxon_concept_attributes => {}
+ other_taxon_concept_id: nil
}
response.should render_template("new")
end
@@ -63,8 +62,7 @@
:taxon_concept_id => taxon_concept.id,
:id => hybrid_relationship.id,
:taxon_relationship => {
- :other_taxon_concept_attributes =>
- build_tc_attributes(:taxon_concept, :name_status => 'H')
+ other_taxon_concept_id: hybrid.id
}
response.should be_success
end
@@ -73,7 +71,7 @@
:taxon_concept_id => taxon_concept.id,
:id => hybrid_relationship.id,
:taxon_relationship => {
- :other_taxon_concept_attributes => { }
+ other_taxon_concept_id: nil
}
JSON.parse(response.body).should include('errors')
end
diff --git a/spec/controllers/admin/synonym_relationships_controller_spec.rb b/spec/controllers/admin/synonym_relationships_controller_spec.rb
index eb0f75e600..8aa3fc614a 100644
--- a/spec/controllers/admin/synonym_relationships_controller_spec.rb
+++ b/spec/controllers/admin/synonym_relationships_controller_spec.rb
@@ -29,8 +29,7 @@
xhr :post, :create,
:taxon_concept_id => taxon_concept.id,
:taxon_relationship => {
- :other_taxon_concept_attributes =>
- build_tc_attributes(:taxon_concept, :name_status => 'S')
+ other_taxon_concept_id: synonym.id
}
response.should render_template("create")
end
@@ -38,7 +37,7 @@
xhr :post, :create,
:taxon_concept_id => taxon_concept.id,
:taxon_relationship => {
- :other_taxon_concept_attributes => {}
+ other_taxon_concept_id: nil
}
response.should render_template("new")
end
@@ -63,8 +62,7 @@
:taxon_concept_id => taxon_concept.id,
:id => synonym_relationship.id,
:taxon_relationship => {
- :other_taxon_concept_attributes =>
- build_tc_attributes(:taxon_concept, :name_status => 'S')
+ other_taxon_concept_id: synonym.id
}
response.should be_success
end
@@ -73,7 +71,7 @@
:taxon_concept_id => taxon_concept.id,
:id => synonym_relationship.id,
:taxon_relationship => {
- :other_taxon_concept_attributes => { }
+ other_taxon_concept_id: nil
}
JSON.parse(response.body).should include('errors')
end
diff --git a/spec/controllers/admin/trade_names_relationships_controller_spec.rb b/spec/controllers/admin/trade_names_relationships_controller_spec.rb
index 86d6364d63..6d84d788b3 100644
--- a/spec/controllers/admin/trade_names_relationships_controller_spec.rb
+++ b/spec/controllers/admin/trade_names_relationships_controller_spec.rb
@@ -29,8 +29,7 @@
xhr :post, :create,
:taxon_concept_id => taxon_concept.id,
:taxon_relationship => {
- :other_taxon_concept_attributes =>
- build_tc_attributes(:taxon_concept, :name_status => 'T')
+ other_taxon_concept_id: trade_name.id
}
response.should render_template("create")
end
@@ -38,7 +37,7 @@
xhr :post, :create,
:taxon_concept_id => taxon_concept.id,
:taxon_relationship => {
- :other_taxon_concept_attributes => {}
+ other_taxon_concept_id: nil
}
response.should render_template("new")
end
@@ -63,8 +62,7 @@
:taxon_concept_id => taxon_concept.id,
:id => trade_name_relationship.id,
:taxon_relationship => {
- :other_taxon_concept_attributes =>
- build_tc_attributes(:taxon_concept, :name_status => 'T')
+ other_taxon_concept_id: trade_name.id
}
response.should be_success
end
@@ -73,7 +71,7 @@
:taxon_concept_id => taxon_concept.id,
:id => trade_name_relationship.id,
:taxon_relationship => {
- :other_taxon_concept_attributes => { }
+ other_taxon_concept_id: nil
}
JSON.parse(response.body).should include('errors')
end
diff --git a/spec/models/hybrid_relationship_spec.rb b/spec/models/hybrid_relationship_spec.rb
index 793fa3d942..c3059872ec 100644
--- a/spec/models/hybrid_relationship_spec.rb
+++ b/spec/models/hybrid_relationship_spec.rb
@@ -19,68 +19,45 @@
:taxon_name => create(:taxon_name, :scientific_name => 'lolcatus')
)
}
- let(:hybrid_attributes){
- build_tc_attributes(
- :taxon_concept,
- :taxonomy => cites_eu,
- :rank => species_rank,
- :name_status => 'H',
- :author_year => 'Hemulen 2013',
- :full_name => 'Lolcatus lolatus x lolcatus'
+
+ let(:hybrid){
+ create_cites_eu_species(
+ name_status: 'H',
+ author_year: 'Hemulen 2013',
+ full_name: 'Lolcatus lolatus x lolcatus'
)
}
- let(:another_hybrid_attributes){
- build_tc_attributes(
- :taxon_concept,
- :taxonomy => cites_eu,
- :rank => species_rank,
- :name_status => 'H',
- :author_year => 'Hemulen 2013',
- :full_name => 'Lolcatus lolcatus x ?'
+ let(:another_hybrid){
+ create_cites_eu_species(
+ name_status: 'H',
+ author_year: 'Hemulen 2013',
+ full_name: 'Lolcatus lolcatus x ?'
)
}
let(:hybrid_rel){
build(
:taxon_relationship,
- :taxon_relationship_type => hybrid_relationship_type,
- :taxon_concept_id => tc.id,
- :other_taxon_concept_id => nil,
- :other_taxon_concept_attributes => hybrid_attributes
+ taxon_relationship_type: hybrid_relationship_type,
+ taxon_concept_id: tc.id,
+ other_taxon_concept_id: hybrid.id
)
}
let(:another_hybrid_rel){
build(
:taxon_relationship,
- :taxon_relationship_type => hybrid_relationship_type,
- :taxon_concept_id => another_tc.id,
- :other_taxon_concept_id => nil,
- :other_taxon_concept_attributes => hybrid_attributes
+ taxon_relationship_type: hybrid_relationship_type,
+ taxon_concept_id: another_tc.id,
+ other_taxon_concept_id: hybrid.id
)
}
specify {
hybrid_rel.save
tc.hybrids.map(&:full_name).should include('Lolcatus lolatus x lolcatus')
}
- specify{
- lambda do
- hybrid_rel.save
- end.should change(TaxonConcept, :count).by(1)
- }
- specify{
- lambda do
- hybrid_rel.save
- another_hybrid_rel.save
- end.should change(TaxonConcept, :count).by(1)
- }
- specify{
- hybrid_rel.save
- another_hybrid_rel.save
- another_tc.hybrids.map(&:full_name).should include('Lolcatus lolatus x lolcatus')
- }
- specify{
+ specify{
hybrid_rel.save
another_hybrid_rel.save
- hybrid_rel.other_taxon_concept_attributes = another_hybrid_attributes
+ hybrid_rel.other_taxon_concept = another_hybrid
hybrid_rel.save
tc.hybrids.map(&:full_name).should include('Lolcatus lolcatus x ?')
another_tc.hybrids.map(&:full_name).should include('Lolcatus lolatus x lolcatus')
diff --git a/spec/models/synonym_relationship_spec.rb b/spec/models/synonym_relationship_spec.rb
index cb997b2269..791ed410e1 100644
--- a/spec/models/synonym_relationship_spec.rb
+++ b/spec/models/synonym_relationship_spec.rb
@@ -19,68 +19,44 @@
:taxon_name => create(:taxon_name, :scientific_name => 'lolcatus')
)
}
- let(:synonym_attributes){
- build_tc_attributes(
- :taxon_concept,
- :taxonomy => cites_eu,
- :rank => species_rank,
- :name_status => 'S',
- :author_year => 'Hemulen 2013',
- :full_name => 'Lolcatus lolus'
+ let(:synonym){
+ create_cites_eu_species(
+ name_status: 'S',
+ author_year: 'Hemulen 2013',
+ full_name: 'Lolcatus lolus'
)
}
- let(:another_synonym_attributes){
- build_tc_attributes(
- :taxon_concept,
- :taxonomy => cites_eu,
- :rank => species_rank,
- :name_status => 'S',
- :author_year => 'Hemulen 2013',
- :full_name => 'Lolcatus lolatus'
+ let(:another_synonym){
+ create_cites_eu_species(
+ name_status: 'S',
+ author_year: 'Hemulen 2013',
+ full_name: 'Lolcatus lolatus'
)
}
let(:synonymy_rel){
build(
:taxon_relationship,
- :taxon_relationship_type => synonym_relationship_type,
- :taxon_concept_id => tc.id,
- :other_taxon_concept_id => nil,
- :other_taxon_concept_attributes => synonym_attributes
+ taxon_relationship_type: synonym_relationship_type,
+ taxon_concept_id: tc.id,
+ other_taxon_concept_id: synonym.id
)
}
let(:another_synonymy_rel){
build(
:taxon_relationship,
- :taxon_relationship_type => synonym_relationship_type,
- :taxon_concept_id => another_tc.id,
- :other_taxon_concept_id => nil,
- :other_taxon_concept_attributes => synonym_attributes
+ taxon_relationship_type: synonym_relationship_type,
+ taxon_concept_id: another_tc.id,
+ other_taxon_concept_id: synonym.id
)
}
specify {
synonymy_rel.save
tc.synonyms.map(&:full_name).should include('Lolcatus lolus')
}
- specify{
- lambda do
- synonymy_rel.save
- end.should change(TaxonConcept, :count).by(1)
- }
- specify{
- lambda do
- synonymy_rel.save
- another_synonymy_rel.save
- end.should change(TaxonConcept, :count).by(1)
- }
- specify{
- synonymy_rel.save
- another_synonymy_rel.save
- another_tc.synonyms.map(&:full_name).should include('Lolcatus lolus')
- }
specify{
synonymy_rel.save
another_synonymy_rel.save
- synonymy_rel.other_taxon_concept_attributes = another_synonym_attributes
+ synonymy_rel.other_taxon_concept = another_synonym
synonymy_rel.save
tc.synonyms.map(&:full_name).should include('Lolcatus lolatus')
another_tc.synonyms.map(&:full_name).should include('Lolcatus lolus')
diff --git a/spec/models/taxon_concept/hybrids_spec.rb b/spec/models/taxon_concept/hybrids_spec.rb
index 542645b5f7..b3ba808532 100644
--- a/spec/models/taxon_concept/hybrids_spec.rb
+++ b/spec/models/taxon_concept/hybrids_spec.rb
@@ -14,35 +14,30 @@
:taxon_name => create(:taxon_name, :scientific_name => 'lolatus')
)
}
- let!(:another_tc){
+ let(:hybrid){
create_cites_eu_species(
- :parent_id => parent.id,
- :taxon_name => create(:taxon_name, :scientific_name => 'lolcatus')
+ name_status: 'H',
+ author_year: 'Taxonomus 2013',
+ taxon_name: create(:taxon_name, :scientific_name => 'Lolcatus lolcatus x lolatus')
)
}
- let(:hybrid){
- build_cites_eu_species(
- :name_status => 'H',
- :author_year => 'Taxonomus 2013',
- :hybrid_parent_scientific_name => tc.full_name,
- :other_hybrid_parent_scientific_name => another_tc.full_name,
- :full_name => 'Lolcatus lolcatus x lolatus'
+ let!(:hybrid_rel){
+ create(:taxon_relationship,
+ taxon_relationship_type: hybrid_relationship_type,
+ taxon_concept_id: tc.id,
+ other_taxon_concept_id: hybrid.id
)
}
context "when new" do
specify {
- lambda do
- hybrid.save
- end.should change(TaxonConcept, :count).by(1)
- }
- pending {
- hybrid.save
tc.has_hybrids?.should be_true
}
specify {
- hybrid.save
hybrid.is_hybrid?.should be_true
}
+ specify {
+ hybrid.full_name.should == 'Lolcatus lolcatus x lolatus'
+ }
end
context "when duplicate" do
let(:duplicate){
@@ -50,9 +45,8 @@
}
specify {
lambda do
- hybrid.save
duplicate.save
- end.should change(TaxonConcept, :count).by(1)
+ end.should change(TaxonConcept, :count).by(0)
}
end
context "when duplicate but author name different" do
@@ -63,13 +57,8 @@
}
specify {
lambda do
- hybrid.save
duplicate.save
- end.should change(TaxonConcept, :count).by(2)
- }
- specify {
- hybrid.save
- hybrid.full_name.should == 'Lolcatus lolcatus x lolatus'
+ end.should change(TaxonConcept, :count).by(1)
}
end
end
diff --git a/spec/models/taxon_concept/synonyms_spec.rb b/spec/models/taxon_concept/synonyms_spec.rb
index 74d0c9f22e..4e9d6f7348 100644
--- a/spec/models/taxon_concept/synonyms_spec.rb
+++ b/spec/models/taxon_concept/synonyms_spec.rb
@@ -15,32 +15,29 @@
)
}
let(:synonym){
- build_cites_eu_species(
+ create_cites_eu_species(
:name_status => 'S',
:author_year => 'Taxonomus 2013',
- :accepted_scientific_name => tc.full_name,
- :full_name => 'Lolcatus lolus'
+ taxon_name: create(:taxon_name, scientific_name: 'Lolcatus lolus')
+ )
+ }
+ let!(:synonym_rel){
+ create(:taxon_relationship,
+ taxon_relationship_type: synonym_relationship_type,
+ taxon_concept_id: tc.id,
+ other_taxon_concept_id: synonym.id
)
}
context "when new" do
specify {
- lambda do
- synonym.save
- end.should change(TaxonConcept, :count).by(1)
- }
- pending {
- lambda do
- synonym.save
- end.should change(TaxonRelationship, :count).by(1)
- }
- pending {
- synonym.save
tc.has_synonyms?.should be_true
}
specify {
- synonym.save
synonym.is_synonym?.should be_true
}
+ specify {
+ synonym.full_name.should == 'Lolcatus lolus'
+ }
end
context "when duplicate" do
let(:duplicate){
@@ -48,15 +45,8 @@
}
specify {
lambda do
- synonym.save
- duplicate.save
- end.should change(TaxonConcept, :count).by(1)
- }
- pending {
- lambda do
- synonym.save
duplicate.save
- end.should change(TaxonRelationship, :count).by(2)
+ end.should change(TaxonConcept, :count).by(0)
}
end
context "when duplicate but author name different" do
@@ -67,13 +57,8 @@
}
specify {
lambda do
- synonym.save
duplicate.save
- end.should change(TaxonConcept, :count).by(2)
- }
- specify {
- synonym.save
- synonym.full_name.should == 'Lolcatus lolus'
+ end.should change(TaxonConcept, :count).by(1)
}
end
context "when has accepted parent" do
diff --git a/spec/models/taxon_concept/trade_names_spec.rb b/spec/models/taxon_concept/trade_names_spec.rb
index 366278368e..5be55ade8c 100644
--- a/spec/models/taxon_concept/trade_names_spec.rb
+++ b/spec/models/taxon_concept/trade_names_spec.rb
@@ -15,32 +15,29 @@
)
}
let(:trade_name){
- build_cites_eu_species(
+ create_cites_eu_species(
:name_status => 'T',
:author_year => 'Taxonomus 2014',
- :accepted_scientific_name => tc.full_name,
- :full_name => 'Lolcatus lolus'
+ taxon_name: create(:taxon_name, scientific_name: 'Lolcatus lolus')
+ )
+ }
+ let!(:trade_name_rel){
+ create(:taxon_relationship,
+ taxon_relationship_type: trade_name_relationship_type,
+ taxon_concept_id: tc.id,
+ other_taxon_concept_id: trade_name.id
)
}
context "when new" do
specify {
- lambda do
- trade_name.save
- end.should change(TaxonConcept, :count).by(1)
- }
- pending {
- lambda do
- trade_name.save
- end.should change(TaxonRelationship, :count).by(1)
- }
- pending {
- trade_name.save
tc.has_trade_names?.should be_true
}
specify {
- trade_name.save
trade_name.is_trade_name?.should be_true
}
+ specify {
+ trade_name.full_name.should == 'Lolcatus lolus'
+ }
end
context "when duplicate" do
let(:duplicate){
@@ -48,15 +45,8 @@
}
specify {
lambda do
- trade_name.save
- duplicate.save
- end.should change(TaxonConcept, :count).by(1)
- }
- pending {
- lambda do
- trade_name.save
duplicate.save
- end.should change(TaxonRelationship, :count).by(2)
+ end.should change(TaxonConcept, :count).by(0)
}
end
context "when duplicate but author name different" do
@@ -67,13 +57,8 @@
}
specify {
lambda do
- trade_name.save
duplicate.save
- end.should change(TaxonConcept, :count).by(2)
- }
- specify {
- trade_name.save
- trade_name.full_name.should == 'Lolcatus lolus'
+ end.should change(TaxonConcept, :count).by(1)
}
end
context "when has accepted parent" do
From 532b3ce07173c0d40f7ba9073f923812c2f757e9 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Wed, 14 Oct 2015 11:54:22 +0100
Subject: [PATCH 055/365] specs for taxon_relationships#destroy
---
.../taxon_relationships_controller_spec.rb | 61 +++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/spec/controllers/admin/taxon_relationships_controller_spec.rb b/spec/controllers/admin/taxon_relationships_controller_spec.rb
index c3754e0e23..811fe85c7b 100644
--- a/spec/controllers/admin/taxon_relationships_controller_spec.rb
+++ b/spec/controllers/admin/taxon_relationships_controller_spec.rb
@@ -42,4 +42,65 @@
end
end
+ describe 'DELETE destroy' do
+ context"when relationship is bidirectional" do
+ let(:taxon_concept){
+ create_cites_eu_species
+ }
+ let(:other_taxon_concept){
+ create_cms_species
+ }
+ let!(:rel){
+ create(:taxon_relationship,
+ taxon_relationship_type: equal_relationship_type,
+ taxon_concept_id: taxon_concept.id,
+ other_taxon_concept_id: other_taxon_concept.id
+ )
+ }
+ context "destroys relationship for taxon concept" do
+ specify {
+ lambda do
+ delete :destroy, taxon_concept_id: taxon_concept.id, id: rel.id
+ end.should change(TaxonRelationship, :count).by(-2)
+ }
+ end
+ context "destroys relationship for other taxon concept" do
+ specify {
+ lambda do
+ delete :destroy, taxon_concept_id: other_taxon_concept.id, id: rel.id
+ end.should change(TaxonRelationship, :count).by(-2)
+ }
+ end
+ end
+ context"when relationship is not bidirectional" do
+ let(:taxon_concept){
+ create_cites_eu_species
+ }
+ let(:other_taxon_concept){
+ create_cites_eu_species(name_status: 'S')
+ }
+ let!(:rel){
+ create(:taxon_relationship,
+ taxon_relationship_type: synonym_relationship_type,
+ taxon_concept_id: taxon_concept.id,
+ other_taxon_concept_id: other_taxon_concept.id
+ )
+ }
+ context "destroys relationship for taxon concept" do
+ specify {
+ lambda do
+ delete :destroy, taxon_concept_id: taxon_concept.id, id: rel.id
+ end.should change(TaxonRelationship, :count).by(-1)
+ }
+ end
+ context "destroys relationship for other taxon concept" do
+ specify {
+ lambda do
+ delete :destroy, taxon_concept_id: other_taxon_concept.id, id: rel.id
+ end.should change(TaxonRelationship, :count).by(-1)
+ }
+ end
+ end
+ end
+
end
From 78b0deb2c4d63baf4251764246e039a8669da862 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Wed, 14 Oct 2015 11:56:02 +0100
Subject: [PATCH 056/365] removed obsolete check
---
app/models/taxon_relationship.rb | 34 +-------------------------------
1 file changed, 1 insertion(+), 33 deletions(-)
diff --git a/app/models/taxon_relationship.rb b/app/models/taxon_relationship.rb
index c09b8e6226..1bdab03261 100644
--- a/app/models/taxon_relationship.rb
+++ b/app/models/taxon_relationship.rb
@@ -15,7 +15,7 @@
class TaxonRelationship < ActiveRecord::Base
track_who_does_it
attr_accessible :taxon_concept_id, :other_taxon_concept_id, :taxon_relationship_type_id,
- :other_taxon_concept_attributes, :created_by_id, :updated_by_id
+ :created_by_id, :updated_by_id
belongs_to :taxon_relationship_type
belongs_to :taxon_concept
belongs_to :other_taxon_concept, :class_name => 'TaxonConcept',
@@ -25,7 +25,6 @@ class TaxonRelationship < ActiveRecord::Base
delegate :is_bidirectional?, :to => :taxon_relationship_type
- before_validation :check_other_taxon_concept_exists
before_destroy :destroy_opposite, :if => Proc.new { self.is_bidirectional? && self.has_opposite? }
after_create :create_opposite, :if => Proc.new { self.is_bidirectional? && !self.has_opposite? }
after_save :update_higher_taxa_for_hybrid_child
@@ -58,37 +57,6 @@ def has_opposite?
private
- def check_other_taxon_concept_exists
- return true unless other_taxon_concept
- required_name_status = case taxon_relationship_type.name
- when TaxonRelationshipType::HAS_SYNONYM
- 'S'
- when TaxonRelationshipType::HAS_TRADE_NAME
- 'T'
- when TaxonRelationshipType::HAS_HYBRID
- 'H'
- else
- 'A'
- end
- existing_tc = TaxonConcept.
- where(:taxonomy_id => other_taxon_concept.taxonomy_id).
- where(:rank_id => other_taxon_concept.rank_id).
- where(:full_name => other_taxon_concept.full_name).
- where(
- if other_taxon_concept.author_year.blank?
- 'SQUISH_NULL(author_year) IS NULL'
- else
- {:author_year => other_taxon_concept.author_year}
- end
- ).
- where(:name_status => required_name_status).first
- if existing_tc
- self.other_taxon_concept = existing_tc
- self.other_taxon_concept_id = existing_tc.id
- end
- true
- end
-
def create_opposite
TaxonRelationship.create(
:taxon_concept_id => self.other_taxon_concept_id,
From c58ba34e3ef03ce3494319e6190a4082dfaeaae6 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Wed, 14 Oct 2015 12:44:28 +0100
Subject: [PATCH 057/365] removed obsolete before_validation callbacks
---
app/models/taxon_concept.rb | 49 +------------------------------------
1 file changed, 1 insertion(+), 48 deletions(-)
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 90327e2d83..9d11f16618 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -190,14 +190,7 @@ class TaxonConcept < ActiveRecord::Base
:if => lambda { |tc| tc.full_name }
before_validation :check_parent_taxon_concept_exists,
:if => lambda { |tc| tc.parent_scientific_name }
- before_validation :check_hybrid_parent_taxon_concept_exists,
- :if => lambda { |tc| tc.is_hybrid? && tc.hybrid_parent_scientific_name }
- before_validation :check_other_hybrid_parent_taxon_concept_exists,
- :if => lambda { |tc| tc.is_hybrid? && tc.other_hybrid_parent_scientific_name }
- before_validation :check_accepted_taxon_concept_exists,
- :if => lambda { |tc| tc.is_synonym? && tc.accepted_scientific_name }
- before_validation :check_accepted_taxon_concept_for_trade_name_exists,
- :if => lambda { |tc| tc.is_trade_name? && tc.accepted_scientific_name }
+
before_validation :ensure_taxonomic_position
translates :nomenclature_note
@@ -420,46 +413,6 @@ def check_taxon_name_exists
true
end
- def check_hybrid_parent_taxon_concept_exists
- check_associated_taxon_concept_exists(:hybrid_parent_scientific_name) do |tc|
- inverse_taxon_relationships.build(
- :taxon_concept_id => tc.id,
- :taxon_relationship_type_id => TaxonRelationshipType.
- find_by_name(TaxonRelationshipType::HAS_HYBRID).id
- )
- end
- end
-
- def check_other_hybrid_parent_taxon_concept_exists
- check_associated_taxon_concept_exists(:other_hybrid_parent_scientific_name) do |tc|
- inverse_taxon_relationships.build(
- :taxon_concept_id => tc.id,
- :taxon_relationship_type_id => TaxonRelationshipType.
- find_by_name(TaxonRelationshipType::HAS_HYBRID).id
- )
- end
- end
-
- def check_accepted_taxon_concept_exists
- check_associated_taxon_concept_exists(:accepted_scientific_name) do |tc|
- inverse_taxon_relationships.build(
- :taxon_concept_id => tc.id,
- :taxon_relationship_type_id => TaxonRelationshipType.
- find_by_name(TaxonRelationshipType::HAS_SYNONYM).id
- )
- end
- end
-
- def check_accepted_taxon_concept_for_trade_name_exists
- check_associated_taxon_concept_exists(:accepted_scientific_name) do |tc|
- inverse_taxon_relationships.build(
- :taxon_concept_id => tc.id,
- :taxon_relationship_type_id => TaxonRelationshipType.
- find_by_name(TaxonRelationshipType::HAS_TRADE_NAME).id
- )
- end
- end
-
def check_parent_taxon_concept_exists
check_associated_taxon_concept_exists(:parent_scientific_name) do |tc|
self.parent_id = tc.id
From 01dabdfd6123cdf9a3e50d0bf71ec8260b270391 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Wed, 14 Oct 2015 19:52:49 +0100
Subject: [PATCH 058/365] Initialise select2 in the edit modal window
---
app/assets/javascripts/admin/admin_in_place_editor.js.coffee | 3 +++
app/views/admin/taxon_concepts/new.js.erb | 1 +
2 files changed, 4 insertions(+)
diff --git a/app/assets/javascripts/admin/admin_in_place_editor.js.coffee b/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
index 2880d855a4..f36d84ac36 100644
--- a/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
+++ b/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
@@ -196,6 +196,9 @@ class AdminInPlaceEditor extends AdminEditor
'option', 'emptytext', 'not current'
)
+ initSelect2Inputs: () ->
+ $('.taxon-concept-multiple').select2($.extend(window.defaultTaxonSelect2Options,window.multiTaxonSelect2Options))
+
class TaxonConceptsEditor extends AdminEditor
init: () ->
super
diff --git a/app/views/admin/taxon_concepts/new.js.erb b/app/views/admin/taxon_concepts/new.js.erb
index 8c3854c60a..e580c3a837 100644
--- a/app/views/admin/taxon_concepts/new.js.erb
+++ b/app/views/admin/taxon_concepts/new.js.erb
@@ -4,3 +4,4 @@ form.find('.tags').select2();
$('#admin-new-<%= controller_name.singularize %>-form').html(form);
$('#new-<%= controller_name.singularize %>').modal('show');
window.adminEditor.initTaxonConceptTypeaheads();
+window.adminEditor.initSelect2Inputs();
From e1fdeb549063a22bce0d19363f1cdd5e5e602464 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Wed, 14 Oct 2015 19:53:17 +0100
Subject: [PATCH 059/365] Select2 to work properly anywhere
---
.../javascripts/admin/nomenclature_changes.js.coffee | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/assets/javascripts/admin/nomenclature_changes.js.coffee b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
index 111a0b6658..4a8b5df674 100644
--- a/app/assets/javascripts/admin/nomenclature_changes.js.coffee
+++ b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
@@ -27,10 +27,10 @@ $(document).ready ->
text: tc.full_name + ' ' + tc.name_status
results: formatted_taxon_concepts
}
- multiTaxonSelect2Options = {
+ window.multiTaxonSelect2Options = {
multiple: true,
initSelection: (element, callback) =>
- id = $(element).val().match(/{(.*)}/)[1]
+ id = $(element).val().match(/({|\[)(.*)(}|\])/)[2]
# Reset value attribute to let Select2 work properly when submitting the values again
$(element).attr('value','')
if (id != null && id != '')
@@ -39,12 +39,12 @@ $(document).ready ->
name_status = $(element).data('name-status')
result = []
for id, i in ids
- result.push({id: id, text: names[i] + ' ' + name_status})
+ result.push({id: id.trim(), text: names[i] + ' ' + name_status})
callback(result)
}
$('.taxon-concept').select2(window.defaultTaxonSelect2Options)
- $('.taxon-concept-multiple').select2($.extend({}, window.defaultTaxonSelect2Options, multiTaxonSelect2Options))
+ $('.taxon-concept-multiple').select2($.extend({}, window.defaultTaxonSelect2Options, window.multiTaxonSelect2Options))
$('.taxon-concept').on('change', (event) ->
return false unless event.val
$.when($.ajax( '/admin/taxon_concepts/' + event.val + '.json' ) ).then(( data, textStatus, jqXHR ) =>
From 21d6caa601b3c101ef6d8fe1690aa9b1761895c2 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Wed, 14 Oct 2015 19:54:37 +0100
Subject: [PATCH 060/365] Rebuild relationship when editing accepted names in
modal
---
.../admin/taxon_concepts_controller.rb | 5 ++-
app/models/nomenclature_change/output.rb | 10 -----
app/models/taxon_concept.rb | 44 ++++++++++++++++++-
3 files changed, 46 insertions(+), 13 deletions(-)
diff --git a/app/controllers/admin/taxon_concepts_controller.rb b/app/controllers/admin/taxon_concepts_controller.rb
index 9a4ca5b665..9ebc6b76a5 100644
--- a/app/controllers/admin/taxon_concepts_controller.rb
+++ b/app/controllers/admin/taxon_concepts_controller.rb
@@ -33,10 +33,10 @@ def edit
def update
@taxon_concept = TaxonConcept.find(params[:id])
- rebuild_taxonomy =
- @taxon_concept.rebuild_taxonomy?(params)
+ rebuild_taxonomy = @taxon_concept.rebuild_taxonomy?(params)
update! do |success, failure|
success.js {
+ @taxon_concept.rebuild_relationships(params)
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
render 'update'
}
@@ -47,6 +47,7 @@ def update
render 'new'
}
success.html {
+ @taxon_concept.rebuild_relationships(params)
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
redirect_to edit_admin_taxon_concept_url(@taxon_concept),
:notice => 'Operation successful'
diff --git a/app/models/nomenclature_change/output.rb b/app/models/nomenclature_change/output.rb
index 767ff07331..c5c1a76d22 100644
--- a/app/models/nomenclature_change/output.rb
+++ b/app/models/nomenclature_change/output.rb
@@ -98,16 +98,6 @@ def tag_list=(ary)
write_attribute(:tag_list, "{#{ary && ary.join(',')}}")
end
- def fetch_accepted_taxons_full_name
- if accepted_taxon_ids.present?
- ActiveRecord::Base.connection.execute(
- <<-SQL
- SELECT tc.full_name FROM taxon_concepts tc WHERE tc.id = ANY (ARRAY#{accepted_taxon_ids.map(&:to_i)})
- SQL
- ).map{ |row| row['full_name']}
- end
- end
-
def populate_taxon_concept_fields
self.parent_id = taxon_concept.parent_id_changed? ? taxon_concept.parent_id_was : taxon_concept.parent_id
self.rank_id = taxon_concept.rank_id_changed? ? taxon_concept.rank_id_was : taxon_concept.rank_id
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 9d11f16618..bf059a0ab0 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -47,7 +47,7 @@ class TaxonConcept < ActiveRecord::Base
:legacy_id, :legacy_type, :full_name, :name_status,
:accepted_scientific_name, :parent_scientific_name,
:hybrid_parent_scientific_name, :other_hybrid_parent_scientific_name,
- :tag_list, :legacy_trade_code,
+ :tag_list, :legacy_trade_code, :accepted_name_ids,
:nomenclature_note_en, :nomenclature_note_es, :nomenclature_note_fr,
:created_by_id, :updated_by_id, :dependents_updated_at
@@ -218,6 +218,16 @@ class TaxonConcept < ActiveRecord::Base
)
}
+ def self.fetch_taxons_full_name(taxon_ids)
+ if taxon_ids.present?
+ ActiveRecord::Base.connection.execute(
+ <<-SQL
+ SELECT tc.full_name FROM taxon_concepts tc WHERE tc.id = ANY (ARRAY#{taxon_ids.map(&:to_i)})
+ SQL
+ ).map{ |row| row['full_name']}
+ end
+ end
+
def has_comments?
general_comment.try(:note).try(:present?) ||
nomenclature_comment.try(:note).try(:present?) ||
@@ -326,6 +336,38 @@ def rebuild_taxonomy?(params)
Rank.in_range(Rank::VARIETY, Rank::GENUS).include?(rank.name)
end
+ def rebuild_relationships(params)
+ all_accepted_name_ids =
+ params[:taxon_concept][:accepted_name_ids].first.split(',').map(&:to_i)
+ new_accepted_name_ids = all_accepted_name_ids - accepted_name_ids
+ removed_accepted_name_ids = accepted_name_ids - all_accepted_name_ids
+ new_accepted_names = TaxonConcept.where(id: new_accepted_name_ids)
+ removed_accepted_names = TaxonConcept.where(id: removed_accepted_name_ids)
+ rel_type =
+ if name_status == 'S'
+ TaxonRelationshipType.
+ find_by_name(TaxonRelationshipType::HAS_SYNONYM)
+ elsif name_status == 'T'
+ TaxonRelationshipType.
+ find_by_name(TaxonRelationshipType::HAS_TRADE_NAME)
+ end
+
+ removed_accepted_names.each do |accepted_name|
+ accepted_name.taxon_relationships.
+ where('other_taxon_concept_id = ? AND rel_type = ?', id, rel_type).
+ first.destroy
+ end
+
+ new_accepted_names.each do |accepted_name|
+ Rails.logger.debug "Creating #{rel_type.name} inverse relationship with #{accepted_name.full_name}"
+ accepted_name.taxon_relationships << TaxonRelationship.new(
+ :taxon_relationship_type_id => rel_type.id,
+ :other_taxon_concept_id => id
+ )
+ accepted_name.save
+ end
+ end
+
private
From 8a2d3b21a277e8d471d48570e28bff20dc6b59d9 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Wed, 14 Oct 2015 19:55:19 +0100
Subject: [PATCH 061/365] Fix function call
---
.../admin/nomenclature_changes/new_name/accepted_names.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/admin/nomenclature_changes/new_name/accepted_names.html.erb b/app/views/admin/nomenclature_changes/new_name/accepted_names.html.erb
index 209a789344..4821be22d5 100644
--- a/app/views/admin/nomenclature_changes/new_name/accepted_names.html.erb
+++ b/app/views/admin/nomenclature_changes/new_name/accepted_names.html.erb
@@ -10,7 +10,7 @@
<%= ff.text_field :accepted_taxon_ids, {
:class => 'taxon-concept-multiple',
- :'data-name' => ff.object.fetch_accepted_taxons_full_name.to_s,
+ :'data-name' => TaxonConcept.fetch_taxons_full_name(ff.object.accepted_taxon_ids).to_s,
:'data-name-status' => 'A',
:'data-name-status-filter' => ['A'].to_json,
:'data-taxonomy-id' => @taxonomy.id,
From 1de36ce36f79373920c1974626d466a486ca2c82 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Wed, 14 Oct 2015 19:56:03 +0100
Subject: [PATCH 062/365] Add the correct input form in edit modal
---
app/helpers/admin/taxon_concepts_helper.rb | 25 +++++++++++++++++++
app/views/admin/taxon_concepts/_form.html.erb | 9 +------
2 files changed, 26 insertions(+), 8 deletions(-)
create mode 100644 app/helpers/admin/taxon_concepts_helper.rb
diff --git a/app/helpers/admin/taxon_concepts_helper.rb b/app/helpers/admin/taxon_concepts_helper.rb
new file mode 100644
index 0000000000..448a54f3ad
--- /dev/null
+++ b/app/helpers/admin/taxon_concepts_helper.rb
@@ -0,0 +1,25 @@
+module Admin::TaxonConceptsHelper
+
+ def dynamic_form_fields f, name_status
+ if ['A', 'N'].include? name_status
+ content_tag(:div, class: 'control-group') do
+ concat content_tag(:label, 'Parent')
+ concat f.text_field(:parent_scientific_name,
+ class: 'typeahead',
+ 'data-rank-scope' => 'parent')
+ end
+ elsif ['S', 'T'].include? name_status
+ content_tag(:div, class: 'control-group') do
+ concat content_tag(:label, 'Accepted names')
+ concat f.text_field(:accepted_name_ids, {
+ :class => 'taxon-concept-multiple',
+ :'data-name' => TaxonConcept.fetch_taxons_full_name(f.object.accepted_name_ids).to_s,
+ :'data-name-status' => 'A',
+ :'data-name-status-filter' => ['A'].to_json,
+ :'data-taxonomy-id' => f.object.taxonomy_id,
+ :multiple => 'multiple'
+ })
+ end
+ end
+ end
+end
diff --git a/app/views/admin/taxon_concepts/_form.html.erb b/app/views/admin/taxon_concepts/_form.html.erb
index 2041778111..aeeeb65666 100644
--- a/app/views/admin/taxon_concepts/_form.html.erb
+++ b/app/views/admin/taxon_concepts/_form.html.erb
@@ -14,14 +14,7 @@
options_from_collection_for_select(@ranks, :id, :name, @taxon_concept && @taxon_concept.rank_id)
%>
- <% if ['A', 'N'].include? @taxon_concept.name_status %>
-
- Parent
- <%= f.text_field :parent_scientific_name, :class => 'typeahead',
- "data-rank-scope" => 'parent'
- %>
-
- <% end %>
+ <%= dynamic_form_fields(f, @taxon_concept.name_status) %>
Scientific name
<%= f.text_field :full_name %>
From 47b2940289232071d7fab966eb231b1b37991814 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Wed, 14 Oct 2015 23:48:52 +0100
Subject: [PATCH 063/365] Code improvement
---
.../admin/taxon_concepts_controller.rb | 4 ++--
app/models/taxon_concept.rb | 23 ++++++++++++-------
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/app/controllers/admin/taxon_concepts_controller.rb b/app/controllers/admin/taxon_concepts_controller.rb
index 9ebc6b76a5..0e15d45685 100644
--- a/app/controllers/admin/taxon_concepts_controller.rb
+++ b/app/controllers/admin/taxon_concepts_controller.rb
@@ -36,7 +36,7 @@ def update
rebuild_taxonomy = @taxon_concept.rebuild_taxonomy?(params)
update! do |success, failure|
success.js {
- @taxon_concept.rebuild_relationships(params)
+ @taxon_concept.rebuild_relationships(params[:taxon_concept])
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
render 'update'
}
@@ -47,7 +47,7 @@ def update
render 'new'
}
success.html {
- @taxon_concept.rebuild_relationships(params)
+ @taxon_concept.rebuild_relationships(params[:taxon_concept])
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
redirect_to edit_admin_taxon_concept_url(@taxon_concept),
:notice => 'Operation successful'
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index bf059a0ab0..3f4a0e2063 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -337,12 +337,7 @@ def rebuild_taxonomy?(params)
end
def rebuild_relationships(params)
- all_accepted_name_ids =
- params[:taxon_concept][:accepted_name_ids].first.split(',').map(&:to_i)
- new_accepted_name_ids = all_accepted_name_ids - accepted_name_ids
- removed_accepted_name_ids = accepted_name_ids - all_accepted_name_ids
- new_accepted_names = TaxonConcept.where(id: new_accepted_name_ids)
- removed_accepted_names = TaxonConcept.where(id: removed_accepted_name_ids)
+ new_accepted_taxa, removed_accepted_taxa = init_accepted_taxa(params)
rel_type =
if name_status == 'S'
TaxonRelationshipType.
@@ -352,13 +347,13 @@ def rebuild_relationships(params)
find_by_name(TaxonRelationshipType::HAS_TRADE_NAME)
end
- removed_accepted_names.each do |accepted_name|
+ removed_accepted_taxa.each do |accepted_name|
accepted_name.taxon_relationships.
where('other_taxon_concept_id = ? AND rel_type = ?', id, rel_type).
first.destroy
end
- new_accepted_names.each do |accepted_name|
+ new_accepted_taxa.each do |accepted_name|
Rails.logger.debug "Creating #{rel_type.name} inverse relationship with #{accepted_name.full_name}"
accepted_name.taxon_relationships << TaxonRelationship.new(
:taxon_relationship_type_id => rel_type.id,
@@ -371,6 +366,18 @@ def rebuild_relationships(params)
private
+ def init_accepted_taxa(params)
+ all_accepted_name_ids =
+ params ? params[:accepted_name_ids].first.split(',').map(&:to_i) : []
+ new_accepted_name_ids = all_accepted_name_ids - accepted_name_ids
+ removed_accepted_name_ids = accepted_name_ids - all_accepted_name_ids
+
+ [
+ TaxonConcept.where(id: new_accepted_name_ids),
+ TaxonConcept.where(id: removed_accepted_name_ids)
+ ]
+ end
+
def dependent_objects_map
{
'children' => children,
From 71eef5e76cdc025e5692822ef0f4d6cde9044297 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Wed, 14 Oct 2015 13:59:32 +0100
Subject: [PATCH 064/365] fixes some of the class loading issues by prviding
class_name as string rather than as constant
---
app/models/distribution.rb | 4 ++
app/models/nomenclature_change/input.rb | 50 +++++++++++--------
.../reassignment_helpers.rb | 10 ++--
.../reassignment_target.rb | 5 +-
app/models/taxon_concept.rb | 5 +-
app/models/taxon_relationship.rb | 6 ++-
6 files changed, 51 insertions(+), 29 deletions(-)
diff --git a/app/models/distribution.rb b/app/models/distribution.rb
index 9c7d922e52..f26d3554ed 100644
--- a/app/models/distribution.rb
+++ b/app/models/distribution.rb
@@ -22,6 +22,10 @@ class Distribution < ActiveRecord::Base
belongs_to :taxon_concept
has_many :distribution_references, :dependent => :destroy
has_many :references, :through => :distribution_references
+ has_many :distribution_reassignments,
+ class_name: 'NomenclatureChange::DistributionReassignment',
+ as: :reassignable,
+ dependent: :destroy
accepts_nested_attributes_for :references, :allow_destroy => true
validates :taxon_concept_id, :uniqueness => { :scope => :geo_entity_id, :message => 'already has this distribution' }
diff --git a/app/models/nomenclature_change/input.rb b/app/models/nomenclature_change/input.rb
index eceefb3f34..8a2be92f4e 100644
--- a/app/models/nomenclature_change/input.rb
+++ b/app/models/nomenclature_change/input.rb
@@ -27,26 +27,36 @@ class NomenclatureChange::Input < ActiveRecord::Base
:legislation_reassignments_attributes
belongs_to :nomenclature_change
belongs_to :taxon_concept
- has_many :reassignments, :inverse_of => :input,
- :class_name => NomenclatureChange::Reassignment,
- :foreign_key => :nomenclature_change_input_id, :dependent => :destroy,
- :autosave => true
- has_many :parent_reassignments, :inverse_of => :input,
- :class_name => NomenclatureChange::ParentReassignment,
- :foreign_key => :nomenclature_change_input_id, :dependent => :destroy,
- :autosave => true
- has_many :name_reassignments, :inverse_of => :input,
- :class_name => NomenclatureChange::NameReassignment,
- :foreign_key => :nomenclature_change_input_id, :dependent => :destroy,
- :autosave => true
- has_many :distribution_reassignments, :inverse_of => :input,
- :class_name => NomenclatureChange::DistributionReassignment,
- :foreign_key => :nomenclature_change_input_id, :dependent => :destroy,
- :autosave => true
- has_many :legislation_reassignments, :inverse_of => :input,
- :class_name => NomenclatureChange::LegislationReassignment,
- :foreign_key => :nomenclature_change_input_id, :dependent => :destroy,
- :autosave => true
+ has_many :reassignments,
+ inverse_of: :input,
+ class_name: 'NomenclatureChange::Reassignment',
+ foreign_key: :nomenclature_change_input_id,
+ dependent: :destroy,
+ autosave: true
+ has_many :parent_reassignments,
+ inverse_of: :input,
+ class_name: 'NomenclatureChange::ParentReassignment',
+ foreign_key: :nomenclature_change_input_id,
+ dependent: :destroy,
+ autosave: true
+ has_many :name_reassignments,
+ inverse_of: :input,
+ class_name: 'NomenclatureChange::NameReassignment',
+ foreign_key: :nomenclature_change_input_id,
+ dependent: :destroy,
+ autosave: true
+ has_many :distribution_reassignments,
+ inverse_of: :input,
+ class_name: 'NomenclatureChange::DistributionReassignment',
+ foreign_key: :nomenclature_change_input_id,
+ dependent: :destroy,
+ autosave: true
+ has_many :legislation_reassignments,
+ inverse_of: :input,
+ class_name: 'NomenclatureChange::LegislationReassignment',
+ foreign_key: :nomenclature_change_input_id,
+ dependent: :destroy,
+ autosave: true
validates :nomenclature_change, :presence => true
validates :taxon_concept, :presence => true
accepts_nested_attributes_for :parent_reassignments, :allow_destroy => true
diff --git a/app/models/nomenclature_change/reassignment_helpers.rb b/app/models/nomenclature_change/reassignment_helpers.rb
index 80c569df44..4d59ceda80 100644
--- a/app/models/nomenclature_change/reassignment_helpers.rb
+++ b/app/models/nomenclature_change/reassignment_helpers.rb
@@ -7,10 +7,12 @@ def self.included(base)
:nomenclature_change_input_id, :nomenclature_change_output_id,
:note_en, :note_es, :note_fr, :internal_note, :output_ids
belongs_to :reassignable, :polymorphic => true
- has_many :reassignment_targets, :inverse_of => :reassignment,
- :class_name => NomenclatureChange::ReassignmentTarget,
- :foreign_key => :nomenclature_change_reassignment_id,
- :dependent => :destroy, :autosave => true
+ has_many :reassignment_targets,
+ inverse_of: :reassignment,
+ class_name: 'NomenclatureChange::ReassignmentTarget',
+ foreign_key: :nomenclature_change_reassignment_id,
+ dependent: :destroy,
+ autosave: true
has_many :outputs, :through => :reassignment_targets
validates :reassignable_type, :presence => true
diff --git a/app/models/nomenclature_change/reassignment_target.rb b/app/models/nomenclature_change/reassignment_target.rb
index 71d3ef8965..8afc362e18 100644
--- a/app/models/nomenclature_change/reassignment_target.rb
+++ b/app/models/nomenclature_change/reassignment_target.rb
@@ -17,8 +17,9 @@ class NomenclatureChange::ReassignmentTarget < ActiveRecord::Base
:nomenclature_change_reassignment_id, :note
belongs_to :output, :class_name => NomenclatureChange::Output,
:foreign_key => :nomenclature_change_output_id
- belongs_to :reassignment, :class_name => NomenclatureChange::Reassignment,
- :foreign_key => :nomenclature_change_reassignment_id
+ belongs_to :reassignment,
+ class_name: 'NomenclatureChange::Reassignment',
+ foreign_key: :nomenclature_change_reassignment_id
validates :reassignment, :presence => true
validates :output, :presence => true
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 3f4a0e2063..5986525b0b 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -158,7 +158,10 @@ class TaxonConcept < ActiveRecord::Base
conditions: {comment_type: 'Nomenclature'}
has_one :distribution_comment, class_name: 'Comment', as: 'commentable',
conditions: {comment_type: 'Distribution'}
- has_many :nomenclature_change_reassignments, :as => :reassignable
+ has_many :parent_reassignments,
+ class_name: 'NomenclatureChange::ParentReassignment',
+ as: :reassignable,
+ dependent: :destroy
has_many :nomenclature_change_inputs, class_name: 'NomenclatureChange::Input'
has_many :nomenclature_change_outputs, class_name: 'NomenclatureChange::Output'
has_many :nomenclature_change_outputs_as_new, class_name: 'NomenclatureChange::Output',
diff --git a/app/models/taxon_relationship.rb b/app/models/taxon_relationship.rb
index 1bdab03261..db744ed470 100644
--- a/app/models/taxon_relationship.rb
+++ b/app/models/taxon_relationship.rb
@@ -20,8 +20,10 @@ class TaxonRelationship < ActiveRecord::Base
belongs_to :taxon_concept
belongs_to :other_taxon_concept, :class_name => 'TaxonConcept',
:foreign_key => :other_taxon_concept_id
- has_many :name_reassignments, :class_name => 'NomenclatureChange::NameReassignment',
- as: :reassignable, dependent: :destroy
+ has_many :name_reassignments,
+ class_name: 'NomenclatureChange::NameReassignment',
+ as: :reassignable,
+ dependent: :destroy
delegate :is_bidirectional?, :to => :taxon_relationship_type
From 9b11ff3507ea7b616b0df6c4c3a20f4e207b0145 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 08:09:36 +0100
Subject: [PATCH 065/365] fixed redirect after deleting a hybrid relationship
---
app/controllers/admin/hybrid_relationships_controller.rb | 8 ++++++++
.../admin/hybrid_relationships_controller_spec.rb | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/app/controllers/admin/hybrid_relationships_controller.rb b/app/controllers/admin/hybrid_relationships_controller.rb
index 32b62d3d0e..0f269f47c6 100644
--- a/app/controllers/admin/hybrid_relationships_controller.rb
+++ b/app/controllers/admin/hybrid_relationships_controller.rb
@@ -48,6 +48,14 @@ def update
end
end
+ def destroy
+ destroy! do |success|
+ success.html {
+ redirect_to admin_taxon_concept_names_path(@taxon_concept)
+ }
+ end
+ end
+
protected
def load_hybrid_relationship_type
diff --git a/spec/controllers/admin/hybrid_relationships_controller_spec.rb b/spec/controllers/admin/hybrid_relationships_controller_spec.rb
index f74a564fed..be3af920a0 100644
--- a/spec/controllers/admin/hybrid_relationships_controller_spec.rb
+++ b/spec/controllers/admin/hybrid_relationships_controller_spec.rb
@@ -83,7 +83,7 @@
:taxon_concept_id => taxon_concept.id,
:id => hybrid_relationship.id
response.should redirect_to(
- edit_admin_taxon_concept_url(hybrid_relationship.taxon_concept)
+ admin_taxon_concept_names_url(hybrid_relationship.taxon_concept)
)
end
end
From f6bcb55857a1275cd92f5c834952bbee03933eaa Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 08:14:24 +0100
Subject: [PATCH 066/365] fixed relationship update specs
---
.../admin/hybrid_relationships_controller_spec.rb | 8 ++++----
.../admin/synonym_relationships_controller_spec.rb | 8 ++++----
.../admin/trade_names_relationships_controller_spec.rb | 8 ++++----
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/spec/controllers/admin/hybrid_relationships_controller_spec.rb b/spec/controllers/admin/hybrid_relationships_controller_spec.rb
index be3af920a0..175a37e38e 100644
--- a/spec/controllers/admin/hybrid_relationships_controller_spec.rb
+++ b/spec/controllers/admin/hybrid_relationships_controller_spec.rb
@@ -58,22 +58,22 @@
describe "XHR PUT update" do
it "responds with 200 when successful" do
- xhr :put, :update, :format => 'json',
+ xhr :put, :update, :format => 'js',
:taxon_concept_id => taxon_concept.id,
:id => hybrid_relationship.id,
:taxon_relationship => {
other_taxon_concept_id: hybrid.id
}
- response.should be_success
+ response.should render_template("create")
end
it "responds with json when not successful" do
- xhr :put, :update, :format => 'json',
+ xhr :put, :update, :format => 'js',
:taxon_concept_id => taxon_concept.id,
:id => hybrid_relationship.id,
:taxon_relationship => {
other_taxon_concept_id: nil
}
- JSON.parse(response.body).should include('errors')
+ response.should render_template('new')
end
end
diff --git a/spec/controllers/admin/synonym_relationships_controller_spec.rb b/spec/controllers/admin/synonym_relationships_controller_spec.rb
index 8aa3fc614a..f00203f585 100644
--- a/spec/controllers/admin/synonym_relationships_controller_spec.rb
+++ b/spec/controllers/admin/synonym_relationships_controller_spec.rb
@@ -58,22 +58,22 @@
describe "XHR PUT update" do
it "responds with 200 when successful" do
- xhr :put, :update, :format => 'json',
+ xhr :put, :update, :format => 'js',
:taxon_concept_id => taxon_concept.id,
:id => synonym_relationship.id,
:taxon_relationship => {
other_taxon_concept_id: synonym.id
}
- response.should be_success
+ response.should render_template('create')
end
it "responds with json when not successful" do
- xhr :put, :update, :format => 'json',
+ xhr :put, :update, :format => 'js',
:taxon_concept_id => taxon_concept.id,
:id => synonym_relationship.id,
:taxon_relationship => {
other_taxon_concept_id: nil
}
- JSON.parse(response.body).should include('errors')
+ response.should render_template('new')
end
end
diff --git a/spec/controllers/admin/trade_names_relationships_controller_spec.rb b/spec/controllers/admin/trade_names_relationships_controller_spec.rb
index 6d84d788b3..992960a332 100644
--- a/spec/controllers/admin/trade_names_relationships_controller_spec.rb
+++ b/spec/controllers/admin/trade_names_relationships_controller_spec.rb
@@ -58,22 +58,22 @@
describe "XHR PUT update" do
it "responds with 200 when successful" do
- xhr :put, :update, :format => 'json',
+ xhr :put, :update, :format => 'js',
:taxon_concept_id => taxon_concept.id,
:id => trade_name_relationship.id,
:taxon_relationship => {
other_taxon_concept_id: trade_name.id
}
- response.should be_success
+ response.should render_template("create")
end
it "responds with json when not successful" do
- xhr :put, :update, :format => 'json',
+ xhr :put, :update, :format => 'js',
:taxon_concept_id => taxon_concept.id,
:id => trade_name_relationship.id,
:taxon_relationship => {
other_taxon_concept_id: nil
}
- JSON.parse(response.body).should include('errors')
+ response.should render_template('new')
end
end
From 1c480477d959236324abfa92e5a923d5276ab0dc Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 08:44:28 +0100
Subject: [PATCH 067/365] spec for updating taxonomy
---
spec/models/taxon_concept/validation_spec.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/spec/models/taxon_concept/validation_spec.rb b/spec/models/taxon_concept/validation_spec.rb
index 379fd44223..d83c305b35 100644
--- a/spec/models/taxon_concept/validation_spec.rb
+++ b/spec/models/taxon_concept/validation_spec.rb
@@ -125,4 +125,9 @@
specify { tc2.should have(1).error_on(:full_name) }
end
end
+ context "update" do
+ let(:tc){ create_cites_eu_species }
+ let!(:tc_child) { create_cites_eu_subspecies(parent_id: tc.id) }
+ specify { tc.taxonomy = cms; tc.should have(1).error_on(:taxonomy_id) }
+ end
end
\ No newline at end of file
From 9a2a9296f185dec957f5cba82d40d7b3b9d574b3 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 09:22:12 +0100
Subject: [PATCH 068/365] removed obsolete accessors
---
app/models/taxon_concept.rb | 5 +----
spec/factories.rb | 3 ---
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 5986525b0b..a5b61d58d0 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -45,15 +45,12 @@ class TaxonConcept < ActiveRecord::Base
attr_accessible :parent_id, :taxonomy_id, :rank_id,
:parent_id, :author_year, :taxon_name_id, :taxonomic_position,
:legacy_id, :legacy_type, :full_name, :name_status,
- :accepted_scientific_name, :parent_scientific_name,
- :hybrid_parent_scientific_name, :other_hybrid_parent_scientific_name,
+ :parent_scientific_name,
:tag_list, :legacy_trade_code, :accepted_name_ids,
:nomenclature_note_en, :nomenclature_note_es, :nomenclature_note_fr,
:created_by_id, :updated_by_id, :dependents_updated_at
attr_writer :parent_scientific_name
- attr_accessor :accepted_scientific_name, :hybrid_parent_scientific_name,
- :other_hybrid_parent_scientific_name
acts_as_taggable
diff --git a/spec/factories.rb b/spec/factories.rb
index 6ab9b63dab..df4fcd0407 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -73,9 +73,6 @@
data {}
listing {}
parent_scientific_name ''
- accepted_scientific_name ''
- hybrid_parent_scientific_name ''
- other_hybrid_parent_scientific_name ''
end
factory :cites_suspension do
From a9c06cb674927c528ff5c3ca5e9a6c186cc1e2ae Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 15 Oct 2015 09:22:24 +0100
Subject: [PATCH 069/365] added missing specs
---
spec/models/taxon_concept/hybrids_spec.rb | 3 +++
spec/models/taxon_concept/synonyms_spec.rb | 3 +++
spec/models/taxon_concept/trade_names_spec.rb | 3 +++
3 files changed, 9 insertions(+)
diff --git a/spec/models/taxon_concept/hybrids_spec.rb b/spec/models/taxon_concept/hybrids_spec.rb
index b3ba808532..035ea1b6f5 100644
--- a/spec/models/taxon_concept/hybrids_spec.rb
+++ b/spec/models/taxon_concept/hybrids_spec.rb
@@ -35,6 +35,9 @@
specify {
hybrid.is_hybrid?.should be_true
}
+ specify{
+ hybrid.has_hybrid_parents?.should be_true
+ }
specify {
hybrid.full_name.should == 'Lolcatus lolcatus x lolatus'
}
diff --git a/spec/models/taxon_concept/synonyms_spec.rb b/spec/models/taxon_concept/synonyms_spec.rb
index 4e9d6f7348..9555719ce7 100644
--- a/spec/models/taxon_concept/synonyms_spec.rb
+++ b/spec/models/taxon_concept/synonyms_spec.rb
@@ -35,6 +35,9 @@
specify {
synonym.is_synonym?.should be_true
}
+ specify{
+ synonym.has_accepted_names?.should be_true
+ }
specify {
synonym.full_name.should == 'Lolcatus lolus'
}
diff --git a/spec/models/taxon_concept/trade_names_spec.rb b/spec/models/taxon_concept/trade_names_spec.rb
index 5be55ade8c..374740aba2 100644
--- a/spec/models/taxon_concept/trade_names_spec.rb
+++ b/spec/models/taxon_concept/trade_names_spec.rb
@@ -35,6 +35,9 @@
specify {
trade_name.is_trade_name?.should be_true
}
+ specify{
+ trade_name.has_accepted_names_for_trade_name?.should be_true
+ }
specify {
trade_name.full_name.should == 'Lolcatus lolus'
}
From e6f2c4330677d0b723250c52480c2f704b5b75c7 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Thu, 15 Oct 2015 11:47:30 +0100
Subject: [PATCH 070/365] Fix bug related to wrong order between taxon id and
name
---
.../javascripts/admin/nomenclature_changes.js.coffee | 6 ++++--
app/models/taxon_concept.rb | 7 ++++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/app/assets/javascripts/admin/nomenclature_changes.js.coffee b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
index 4a8b5df674..e547e53b44 100644
--- a/app/assets/javascripts/admin/nomenclature_changes.js.coffee
+++ b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
@@ -34,12 +34,14 @@ $(document).ready ->
# Reset value attribute to let Select2 work properly when submitting the values again
$(element).attr('value','')
if (id != null && id != '')
- ids = id.split(',')
+ ids = id.split(',').map( (id) ->
+ parseInt(id.trim())
+ ).sort( (a, b) -> a - b)
names = $(element).data('name')
name_status = $(element).data('name-status')
result = []
for id, i in ids
- result.push({id: id.trim(), text: names[i] + ' ' + name_status})
+ result.push({id: id, text: names[i] + ' ' + name_status})
callback(result)
}
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index a5b61d58d0..865b817fb8 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -222,7 +222,10 @@ def self.fetch_taxons_full_name(taxon_ids)
if taxon_ids.present?
ActiveRecord::Base.connection.execute(
<<-SQL
- SELECT tc.full_name FROM taxon_concepts tc WHERE tc.id = ANY (ARRAY#{taxon_ids.map(&:to_i)})
+ SELECT tc.full_name
+ FROM taxon_concepts tc
+ WHERE tc.id = ANY (ARRAY#{taxon_ids.map(&:to_i)})
+ ORDER BY tc.id
SQL
).map{ |row| row['full_name']}
end
@@ -336,6 +339,8 @@ def rebuild_taxonomy?(params)
Rank.in_range(Rank::VARIETY, Rank::GENUS).include?(rank.name)
end
+ #TODO
+ # save changes button won't work once already submitted
def rebuild_relationships(params)
new_accepted_taxa, removed_accepted_taxa = init_accepted_taxa(params)
rel_type =
From a7b40b665dbdd337c6609d8f898457cbc127ba75 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Thu, 15 Oct 2015 13:53:52 +0100
Subject: [PATCH 071/365] Fix accepted names for trade names
---
app/helpers/admin/taxon_concepts_helper.rb | 6 ++++--
app/models/taxon_concept.rb | 12 ++++++++++--
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/app/helpers/admin/taxon_concepts_helper.rb b/app/helpers/admin/taxon_concepts_helper.rb
index 448a54f3ad..59b18dbfb8 100644
--- a/app/helpers/admin/taxon_concepts_helper.rb
+++ b/app/helpers/admin/taxon_concepts_helper.rb
@@ -9,11 +9,13 @@ def dynamic_form_fields f, name_status
'data-rank-scope' => 'parent')
end
elsif ['S', 'T'].include? name_status
+ name_ids =
+ name_status == 'S' ? :accepted_name_ids : :accepted_names_for_trade_name_ids
content_tag(:div, class: 'control-group') do
concat content_tag(:label, 'Accepted names')
- concat f.text_field(:accepted_name_ids, {
+ concat f.text_field(name_ids, {
:class => 'taxon-concept-multiple',
- :'data-name' => TaxonConcept.fetch_taxons_full_name(f.object.accepted_name_ids).to_s,
+ :'data-name' => TaxonConcept.fetch_taxons_full_name(f.object.send(name_ids)).to_s,
:'data-name-status' => 'A',
:'data-name-status-filter' => ['A'].to_json,
:'data-taxonomy-id' => f.object.taxonomy_id,
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 865b817fb8..1357c1302a 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -46,7 +46,8 @@ class TaxonConcept < ActiveRecord::Base
:parent_id, :author_year, :taxon_name_id, :taxonomic_position,
:legacy_id, :legacy_type, :full_name, :name_status,
:parent_scientific_name,
- :tag_list, :legacy_trade_code, :accepted_name_ids,
+ :tag_list, :legacy_trade_code,
+ :accepted_name_ids, :accepted_names_for_trade_name_ids,
:nomenclature_note_en, :nomenclature_note_es, :nomenclature_note_fr,
:created_by_id, :updated_by_id, :dependents_updated_at
@@ -372,8 +373,15 @@ def rebuild_relationships(params)
private
def init_accepted_taxa(params)
+ name_ids =
+ case name_status
+ when 'S' then :accepted_name_ids
+ when 'T' then :accepted_names_for_trade_name_ids
+ else return []
+ end
+
all_accepted_name_ids =
- params ? params[:accepted_name_ids].first.split(',').map(&:to_i) : []
+ params ? params[name_ids].first.split(',').map(&:to_i) : []
new_accepted_name_ids = all_accepted_name_ids - accepted_name_ids
removed_accepted_name_ids = accepted_name_ids - all_accepted_name_ids
From de9de1d2828698c2d45524a3babd266da51a509e Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Thu, 15 Oct 2015 14:01:13 +0100
Subject: [PATCH 072/365] Bug fix to return array of empty arrays
---
app/models/taxon_concept.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 1357c1302a..01e29e0898 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -377,7 +377,7 @@ def init_accepted_taxa(params)
case name_status
when 'S' then :accepted_name_ids
when 'T' then :accepted_names_for_trade_name_ids
- else return []
+ else return [[],[]]
end
all_accepted_name_ids =
From 0fec322ee3e53128b84fc7f236a5c6efb4a8414e Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Fri, 16 Oct 2015 16:03:06 +0100
Subject: [PATCH 073/365] Initialise taxon concept single selection with
select2
---
app/assets/javascripts/admin/admin_in_place_editor.js.coffee | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/assets/javascripts/admin/admin_in_place_editor.js.coffee b/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
index f36d84ac36..f42baad525 100644
--- a/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
+++ b/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
@@ -197,7 +197,8 @@ class AdminInPlaceEditor extends AdminEditor
)
initSelect2Inputs: () ->
- $('.taxon-concept-multiple').select2($.extend(window.defaultTaxonSelect2Options,window.multiTaxonSelect2Options))
+ $('.taxon-concept').select2(window.defaultTaxonSelect2Options)
+ $('.taxon-concept-multiple').select2($.extend({}, window.defaultTaxonSelect2Options,window.multiTaxonSelect2Options))
class TaxonConceptsEditor extends AdminEditor
init: () ->
From 5ab1491a60882ef8d770d08aabccf2d5876c944e Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Fri, 16 Oct 2015 16:04:02 +0100
Subject: [PATCH 074/365] Dynamically generate tc edit form
---
.../admin/taxon_concepts_controller.rb | 20 +++++++++++++++++--
app/views/admin/taxon_concepts/_form.html.erb | 2 +-
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/app/controllers/admin/taxon_concepts_controller.rb b/app/controllers/admin/taxon_concepts_controller.rb
index 0e15d45685..d604c75ada 100644
--- a/app/controllers/admin/taxon_concepts_controller.rb
+++ b/app/controllers/admin/taxon_concepts_controller.rb
@@ -2,6 +2,7 @@ class Admin::TaxonConceptsController < Admin::StandardAuthorizationController
respond_to :json
layout :determine_layout
before_filter :sanitize_search_params, :only => [:index, :autocomplete]
+ before_filter :sanitize_update_params, :only => [:update]
before_filter :load_tags, :only => [:index, :edit, :create]
def index
@@ -36,7 +37,7 @@ def update
rebuild_taxonomy = @taxon_concept.rebuild_taxonomy?(params)
update! do |success, failure|
success.js {
- @taxon_concept.rebuild_relationships(params[:taxon_concept])
+ @taxon_concept.rebuild_relationships(@taxa_ids)
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
render 'update'
}
@@ -47,7 +48,7 @@ def update
render 'new'
}
success.html {
- @taxon_concept.rebuild_relationships(params[:taxon_concept])
+ @taxon_concept.rebuild_relationships(@taxa_ids)
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
redirect_to edit_admin_taxon_concept_url(@taxon_concept),
:notice => 'Operation successful'
@@ -90,6 +91,21 @@ def sanitize_search_params
})
end
+ def sanitize_update_params
+ name_status = params[:taxon_concept][:name_status]
+ if params[:taxon_concept]
+ name_ids =
+ case name_status
+ when 'S' then :accepted_name_ids
+ when 'T' then :accepted_names_for_trade_name_ids
+ when 'H' then :hybrid_parent_ids
+ else return []
+ end
+ @taxa_ids =
+ params[:taxon_concept].delete(name_ids).first.split(',').map(&:to_i)
+ end
+ end
+
def load_tags
@tags = PresetTag.where(:model => PresetTag::TYPES[:TaxonConcept])
end
diff --git a/app/views/admin/taxon_concepts/_form.html.erb b/app/views/admin/taxon_concepts/_form.html.erb
index aeeeb65666..abcaac9ffc 100644
--- a/app/views/admin/taxon_concepts/_form.html.erb
+++ b/app/views/admin/taxon_concepts/_form.html.erb
@@ -14,7 +14,7 @@
options_from_collection_for_select(@ranks, :id, :name, @taxon_concept && @taxon_concept.rank_id)
%>
- <%= dynamic_form_fields(f, @taxon_concept.name_status) %>
+ <%= name_status_related_fields(f, @taxon_concept.name_status) %>
Scientific name
<%= f.text_field :full_name %>
From 1c07fa22ef06de5f804109fcc26afe86193e1fce Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Fri, 16 Oct 2015 16:05:02 +0100
Subject: [PATCH 075/365] Generate tc form, forgotten file
---
app/helpers/admin/taxon_concepts_helper.rb | 80 ++++++++++++++++------
1 file changed, 58 insertions(+), 22 deletions(-)
diff --git a/app/helpers/admin/taxon_concepts_helper.rb b/app/helpers/admin/taxon_concepts_helper.rb
index 59b18dbfb8..996667fb8a 100644
--- a/app/helpers/admin/taxon_concepts_helper.rb
+++ b/app/helpers/admin/taxon_concepts_helper.rb
@@ -1,27 +1,63 @@
module Admin::TaxonConceptsHelper
- def dynamic_form_fields f, name_status
- if ['A', 'N'].include? name_status
- content_tag(:div, class: 'control-group') do
- concat content_tag(:label, 'Parent')
- concat f.text_field(:parent_scientific_name,
- class: 'typeahead',
- 'data-rank-scope' => 'parent')
- end
- elsif ['S', 'T'].include? name_status
- name_ids =
- name_status == 'S' ? :accepted_name_ids : :accepted_names_for_trade_name_ids
- content_tag(:div, class: 'control-group') do
- concat content_tag(:label, 'Accepted names')
- concat f.text_field(name_ids, {
- :class => 'taxon-concept-multiple',
- :'data-name' => TaxonConcept.fetch_taxons_full_name(f.object.send(name_ids)).to_s,
- :'data-name-status' => 'A',
- :'data-name-status-filter' => ['A'].to_json,
- :'data-taxonomy-id' => f.object.taxonomy_id,
- :multiple => 'multiple'
- })
- end
+ DEFAULT_OPTS = {
+ klass: 'taxon-concept-multiple',
+ multiple: 'multiple',
+ data_name_status: 'A'
+ }
+ def fields_opts f, name_status
+ case name_status
+ when 'A', 'N'
+ DEFAULT_OPTS.merge({
+ label: 'Parent',
+ klass: 'taxon-concept parent-taxon',
+ field_name: :parent_id,
+ data_name: f.object.parent.try(:full_name),
+ data_name_status: f.object.parent.try(:name_status),
+ multiple: ''
+ })
+ when 'S'
+ DEFAULT_OPTS.merge({
+ label: "Accepted names",
+ field_name: :accepted_name_ids,
+ data_name: TaxonConcept.fetch_taxons_full_name(
+ f.object.accepted_name_ids
+ ).to_s,
+ })
+ when 'T'
+ DEFAULT_OPTS.merge({
+ label: "Accepted names",
+ field_name: :accepted_names_for_trade_name_ids,
+ data_name: TaxonConcept.fetch_taxons_full_name(
+ f.object.accepted_names_for_trade_name_ids
+ ).to_s,
+ })
+ when 'H'
+ DEFAULT_OPTS.merge({
+ label: 'Parents',
+ field_name: :hybrid_parent_ids,
+ data_name: TaxonConcept.fetch_taxons_full_name(
+ f.object.hybrid_parent_ids
+ ).to_s,
+ })
+ end
+ end
+
+ def name_status_related_fields f, name_status
+ generate_input_form(f, fields_opts(f, name_status))
+ end
+
+ def generate_input_form(f, opts={})
+ content_tag(:div, class: 'control-group') do
+ concat content_tag(:label, opts[:label])
+ concat f.text_field(opts[:field_name], {
+ :class => opts[:klass],
+ :'data-name' => opts[:data_name],
+ :'data-name-status' => 'A',
+ :'data-name-status-filter' => ['A'].to_json,
+ :'data-taxonomy-id' => f.object.taxonomy_id,
+ opts[:multiple] => opts[:multiple]
+ })
end
end
end
From c2dd7c1fcf27faf36231b164b8bd3be8f1624fae Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Fri, 16 Oct 2015 17:19:36 +0100
Subject: [PATCH 076/365] code improvement
---
.../admin/taxon_concepts_controller.rb | 10 +--
app/models/taxon_concept.rb | 65 +++++++++----------
2 files changed, 38 insertions(+), 37 deletions(-)
diff --git a/app/controllers/admin/taxon_concepts_controller.rb b/app/controllers/admin/taxon_concepts_controller.rb
index d604c75ada..bdcf177e81 100644
--- a/app/controllers/admin/taxon_concepts_controller.rb
+++ b/app/controllers/admin/taxon_concepts_controller.rb
@@ -2,7 +2,6 @@ class Admin::TaxonConceptsController < Admin::StandardAuthorizationController
respond_to :json
layout :determine_layout
before_filter :sanitize_search_params, :only => [:index, :autocomplete]
- before_filter :sanitize_update_params, :only => [:update]
before_filter :load_tags, :only => [:index, :edit, :create]
def index
@@ -34,10 +33,11 @@ def edit
def update
@taxon_concept = TaxonConcept.find(params[:id])
+ taxa_ids = sanitize_update_params
rebuild_taxonomy = @taxon_concept.rebuild_taxonomy?(params)
update! do |success, failure|
success.js {
- @taxon_concept.rebuild_relationships(@taxa_ids)
+ @taxon_concept.rebuild_relationships(taxa_ids) if taxa_ids.present?
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
render 'update'
}
@@ -48,7 +48,7 @@ def update
render 'new'
}
success.html {
- @taxon_concept.rebuild_relationships(@taxa_ids)
+ @taxon_concept.rebuild_relationships(taxa_ids) if taxa_ids.present?
UpdateTaxonomyWorker.perform_async if rebuild_taxonomy
redirect_to edit_admin_taxon_concept_url(@taxon_concept),
:notice => 'Operation successful'
@@ -93,6 +93,7 @@ def sanitize_search_params
def sanitize_update_params
name_status = params[:taxon_concept][:name_status]
+ taxa_ids = []
if params[:taxon_concept]
name_ids =
case name_status
@@ -101,9 +102,10 @@ def sanitize_update_params
when 'H' then :hybrid_parent_ids
else return []
end
- @taxa_ids =
+ taxa_ids =
params[:taxon_concept].delete(name_ids).first.split(',').map(&:to_i)
end
+ taxa_ids
end
def load_tags
diff --git a/app/models/taxon_concept.rb b/app/models/taxon_concept.rb
index 01e29e0898..dfe702ddd7 100644
--- a/app/models/taxon_concept.rb
+++ b/app/models/taxon_concept.rb
@@ -46,13 +46,12 @@ class TaxonConcept < ActiveRecord::Base
:parent_id, :author_year, :taxon_name_id, :taxonomic_position,
:legacy_id, :legacy_type, :full_name, :name_status,
:parent_scientific_name,
- :tag_list, :legacy_trade_code,
+ :tag_list, :legacy_trade_code, :hybrid_parent_ids,
:accepted_name_ids, :accepted_names_for_trade_name_ids,
:nomenclature_note_en, :nomenclature_note_es, :nomenclature_note_fr,
:created_by_id, :updated_by_id, :dependents_updated_at
attr_writer :parent_scientific_name
-
acts_as_taggable
serialize :data, ActiveRecord::Coders::Hstore
@@ -340,54 +339,55 @@ def rebuild_taxonomy?(params)
Rank.in_range(Rank::VARIETY, Rank::GENUS).include?(rank.name)
end
- #TODO
- # save changes button won't work once already submitted
- def rebuild_relationships(params)
- new_accepted_taxa, removed_accepted_taxa = init_accepted_taxa(params)
- rel_type =
- if name_status == 'S'
- TaxonRelationshipType.
- find_by_name(TaxonRelationshipType::HAS_SYNONYM)
- elsif name_status == 'T'
- TaxonRelationshipType.
- find_by_name(TaxonRelationshipType::HAS_TRADE_NAME)
- end
+ def rebuild_relationships(taxa_ids)
+ if ['S', 'T', 'H'].include? name_status
+ new_taxa, removed_taxa = init_accepted_taxa(taxa_ids)
+ rel_type =
+ case name_status
+ when 'S'
+ TaxonRelationshipType.find_by_name(TaxonRelationshipType::HAS_SYNONYM)
+ when 'T'
+ TaxonRelationshipType.find_by_name(TaxonRelationshipType::HAS_TRADE_NAME)
+ when 'H'
+ TaxonRelationshipType.find_by_name(TaxonRelationshipType::HAS_HYBRID)
+ end
+ add_remove_relationships(new_taxa, removed_taxa, rel_type)
+ end
+ end
+
+ private
- removed_accepted_taxa.each do |accepted_name|
- accepted_name.taxon_relationships.
- where('other_taxon_concept_id = ? AND rel_type = ?', id, rel_type).
+ def add_remove_relationships(new_taxa, removed_taxa, rel_type)
+ removed_taxa.each do |taxon_concept|
+ taxon_concept.taxon_relationships.
+ where('other_taxon_concept_id = ? AND
+ taxon_relationship_type_id = ?', id, rel_type.id).
first.destroy
end
- new_accepted_taxa.each do |accepted_name|
- Rails.logger.debug "Creating #{rel_type.name} inverse relationship with #{accepted_name.full_name}"
- accepted_name.taxon_relationships << TaxonRelationship.new(
+ new_taxa.each do |taxon_concept|
+ taxon_concept.taxon_relationships << TaxonRelationship.new(
:taxon_relationship_type_id => rel_type.id,
:other_taxon_concept_id => id
)
- accepted_name.save
end
end
-
- private
-
- def init_accepted_taxa(params)
+ def init_accepted_taxa(all_taxa_ids)
name_ids =
case name_status
when 'S' then :accepted_name_ids
when 'T' then :accepted_names_for_trade_name_ids
+ when 'H' then :hybrid_parent_ids
else return [[],[]]
end
-
- all_accepted_name_ids =
- params ? params[name_ids].first.split(',').map(&:to_i) : []
- new_accepted_name_ids = all_accepted_name_ids - accepted_name_ids
- removed_accepted_name_ids = accepted_name_ids - all_accepted_name_ids
+ current_name_ids = send(name_ids)
+ new_taxa_ids = all_taxa_ids - current_name_ids
+ removed_taxa_ids = current_name_ids - all_taxa_ids
[
- TaxonConcept.where(id: new_accepted_name_ids),
- TaxonConcept.where(id: removed_accepted_name_ids)
+ TaxonConcept.where(id: new_taxa_ids),
+ TaxonConcept.where(id: removed_taxa_ids)
]
end
@@ -528,5 +528,4 @@ def ensure_taxonomic_position
true
end
-
end
From 422f5427db00c1a72a01b6d9f0daf0119b8e3322 Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Sun, 18 Oct 2015 15:31:51 +0200
Subject: [PATCH 077/365] Fix test exception
---
app/controllers/admin/taxon_concepts_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/admin/taxon_concepts_controller.rb b/app/controllers/admin/taxon_concepts_controller.rb
index bdcf177e81..efc0b8b0e5 100644
--- a/app/controllers/admin/taxon_concepts_controller.rb
+++ b/app/controllers/admin/taxon_concepts_controller.rb
@@ -92,7 +92,7 @@ def sanitize_search_params
end
def sanitize_update_params
- name_status = params[:taxon_concept][:name_status]
+ name_status = params[:taxon_concept] ? params[:taxon_concept][:name_status] : ''
taxa_ids = []
if params[:taxon_concept]
name_ids =
From 741cc01fa61189a4bf7181e6e06cf25023171aca Mon Sep 17 00:00:00 2001
From: Ferdinando Primerano
Date: Sun, 18 Oct 2015 15:32:09 +0200
Subject: [PATCH 078/365] Limit hybrids selection to 2
---
app/assets/javascripts/admin/admin_in_place_editor.js.coffee | 1 +
app/assets/javascripts/admin/nomenclature_changes.js.coffee | 5 +++++
app/helpers/admin/taxon_concepts_helper.rb | 1 +
3 files changed, 7 insertions(+)
diff --git a/app/assets/javascripts/admin/admin_in_place_editor.js.coffee b/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
index f42baad525..4b587a8361 100644
--- a/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
+++ b/app/assets/javascripts/admin/admin_in_place_editor.js.coffee
@@ -199,6 +199,7 @@ class AdminInPlaceEditor extends AdminEditor
initSelect2Inputs: () ->
$('.taxon-concept').select2(window.defaultTaxonSelect2Options)
$('.taxon-concept-multiple').select2($.extend({}, window.defaultTaxonSelect2Options,window.multiTaxonSelect2Options))
+ $('.hybrids-selection').select2($.extend({}, window.defaultTaxonSelect2Options, window.multiTaxonSelect2Options, window.hybridsSelect2Options))
class TaxonConceptsEditor extends AdminEditor
init: () ->
diff --git a/app/assets/javascripts/admin/nomenclature_changes.js.coffee b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
index e547e53b44..04b256ea1a 100644
--- a/app/assets/javascripts/admin/nomenclature_changes.js.coffee
+++ b/app/assets/javascripts/admin/nomenclature_changes.js.coffee
@@ -44,6 +44,11 @@ $(document).ready ->
result.push({id: id, text: names[i] + ' ' + name_status})
callback(result)
}
+ window.hybridsSelect2Options = {
+ maximumSelectionSize: 2,
+ formatSelectionTooBig: (limit) ->
+ return 'You can only select ' + limit + ' items'
+ }
$('.taxon-concept').select2(window.defaultTaxonSelect2Options)
$('.taxon-concept-multiple').select2($.extend({}, window.defaultTaxonSelect2Options, window.multiTaxonSelect2Options))
diff --git a/app/helpers/admin/taxon_concepts_helper.rb b/app/helpers/admin/taxon_concepts_helper.rb
index 996667fb8a..4f61a7f2e2 100644
--- a/app/helpers/admin/taxon_concepts_helper.rb
+++ b/app/helpers/admin/taxon_concepts_helper.rb
@@ -34,6 +34,7 @@ def fields_opts f, name_status
})
when 'H'
DEFAULT_OPTS.merge({
+ klass: 'hybrids-selection',
label: 'Parents',
field_name: :hybrid_parent_ids,
data_name: TaxonConcept.fetch_taxons_full_name(
From 3b348c12e0bfbdf43daaca66eb35e0e110097fdd Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 21 Jan 2016 22:21:41 +0000
Subject: [PATCH 079/365] redis config in rails secrets
---
config/secrets.yml.example | 1 -
config/secrets.yml.travis | 1 -
2 files changed, 2 deletions(-)
diff --git a/config/secrets.yml.example b/config/secrets.yml.example
index c69a172f7c..22b224d43c 100644
--- a/config/secrets.yml.example
+++ b/config/secrets.yml.example
@@ -1,7 +1,6 @@
common: &defaults
secret_key_base: 'e09049f49c23855f0d6b52c864796e27708bbd61d37920fc01b9641e4310ed901ca77a0a827c6384509f17e81c8c68c7446658a70bc4780eae740803d045323b'
redis:
- namespace: 'SAPI'
url: 'redis://127.0.0.1:6379/1'
development:
diff --git a/config/secrets.yml.travis b/config/secrets.yml.travis
index c69a172f7c..22b224d43c 100644
--- a/config/secrets.yml.travis
+++ b/config/secrets.yml.travis
@@ -1,7 +1,6 @@
common: &defaults
secret_key_base: 'e09049f49c23855f0d6b52c864796e27708bbd61d37920fc01b9641e4310ed901ca77a0a827c6384509f17e81c8c68c7446658a70bc4780eae740803d045323b'
redis:
- namespace: 'SAPI'
url: 'redis://127.0.0.1:6379/1'
development:
From cdd921c2cb4eccf38e9fae58f1dcefc54f2b9cd2 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 21 Jan 2016 22:38:13 +0000
Subject: [PATCH 080/365] added dogapi gem for recording capistrano deployments
---
Capfile | 4 ++++
Gemfile | 1 +
Gemfile.lock | 2 ++
vendor/cache/dogapi-1.21.0.gem | Bin 0 -> 35840 bytes
4 files changed, 7 insertions(+)
create mode 100644 vendor/cache/dogapi-1.21.0.gem
diff --git a/Capfile b/Capfile
index 59f216cf1d..55f7162a8d 100644
--- a/Capfile
+++ b/Capfile
@@ -2,6 +2,10 @@
require 'dotenv'
Dotenv.load
+# DataDog deployment events
+require "capistrano/datadog"
+set :datadog_api_key, "5a2b3ffdb12de3ae0f25b12610457dbb"
+
# Load DSL and set up stages
require 'capistrano/setup'
diff --git a/Gemfile b/Gemfile
index 805715ef84..9815b9e800 100644
--- a/Gemfile
+++ b/Gemfile
@@ -107,6 +107,7 @@ group :development do
gem 'webrick', '1.3.1'
gem 'jslint_on_rails'
gem 'git_pretty_accept'
+ gem 'dogapi', '>= 1.3.0'
end
group :test, :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index b9867a8df1..6a016d18ff 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -165,6 +165,8 @@ GEM
warden (~> 1.2.3)
diff-lcs (1.1.3)
docile (1.1.5)
+ dogapi (1.21.0)
+ multi_json
domain_name (0.5.20160216)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.0.1)
diff --git a/vendor/cache/dogapi-1.21.0.gem b/vendor/cache/dogapi-1.21.0.gem
new file mode 100644
index 0000000000000000000000000000000000000000..d62821a3d973af712406c07cc8e05125251c3122
GIT binary patch
literal 35840
zcmeFXQ;;r95H_~9ZQHhOpS5k
zy85v*b2TzGay4SG@CN$7N|^o=Ha0e(|5^Vh|D$GMVPywmX5nCF<7DFCVE=C(GbX#L78&$MAOVP*qM5dW3}r{$*jP&a;t+^
z`Lu&Lpv*!4`NJ1e#ka{U9eZZW6>BSXsdY{ob5a+_(Wh}}vBg^~t2BSx`4Vd#g2@co
z4YBjYV(6agS}^~{VOh#*N^|4<{3K9SV6ewiF5QhTO}v|;C{knr5-o7!*d_2+wb%!p9|zvUng`T~ZswyI??x)SOX3mmSw;&MuI?oL_rnp(=zUu!
zc(d_{E!Ws3(k>*l^?^ZJAmBkNg*~Oig1$mi@__Qm_a)7}7RGf0f9F)b=dOlG@+m0u
z$j%x-iY`|-Fr}VT2K`O{viAg?%{?6lWSx!?TISKd{y~pr%s-|C%L_5eURwpt;9`Gm
zF~Fc0ZEdtdk)#mt3qTeY?{GZnF24@PF!Ub}>F$=#{7cdfx~kcUr1`8@AIJ;4__2w=
zPHx{do*Xle#c)>fuiz|dZ-|~t2FBitxREsOTM5@T=3v1XN~UctyRKb&HO=wpA7{ng
z?3qIVx8h&Ch<0}iq=H@j+?hSSnYZo(sCtWP6m44-p%Xr0Adlw1%(>68tF^Nj#&M1R
zojkQj;mu6+x8Hg;SnghYa=v}QvP@Nn5Lv$6wRenbCf&nNz{3gofP5
z(SjY{RT_Jy2=cDJK1^c?n5t~u?mDqwoaGozoSXdw31J1~QF!2zG+hA4I$CRA$~#=l
zlM?7yM4A758fc{kFZ~?dBG4Cle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!zKobF({fzXlq+?mH-Nm>Sli!VGWtNO?JGP30P`
z8CA_yIL$Liowk{>ZGOE{@wl0xAD!}|n37v7a4MjAhQ1F7g1>@%=4*V>-v`_Vqj3fc
zutHpKm;qd7*2Fy*D0*PXLp!cA`&^r+GM_)@`pvoUV;SJeeQ_^`9aMsGS2&e#8aQ5T
zn82oR!Y>q{bAn>Y$Lg=QX7bK`*hCM4v=vcI^3_KRNo_|>2TCkYadN46p``x(`jhcd
zXB%ezbKSh(T8Kcw?)j_-FQ$FT)0@N~NX+zZhsx!J?}OkA5uo^S4g7W(1_HrBB)Qf8zqq{N32u*+KrR|8DXR`G2!>
zvT*&!|NFn=OZnga-{uK?D&WHKV(;0cSkR4Mmp=2ev#wx(3afOr>|6>8H^QkCnY&Am
z&aU3>{!f?gfTe*s!l%1i|K6~Q7%e3}r?NQ<@piLMqh`1
zFgz8r-T9TwIZ`PI9C5ghQrMkdz0>~8(t)rklx
literal 0
HcmV?d00001
From e6155b8f991b646af1e5def066e425d4c2697914 Mon Sep 17 00:00:00 2001
From: Agnieszka Figiel
Date: Thu, 18 Feb 2016 14:09:02 +0000
Subject: [PATCH 081/365] Revert "added dogapi gem for recording capistrano
deployments"
This reverts commit 8f6003d896ecf92f3d2ee921ac1e63878c9e22e6.
---
Capfile | 4 ----
Gemfile | 1 -
Gemfile.lock | 2 --
vendor/cache/dogapi-1.21.0.gem | Bin 35840 -> 0 bytes
4 files changed, 7 deletions(-)
delete mode 100644 vendor/cache/dogapi-1.21.0.gem
diff --git a/Capfile b/Capfile
index 55f7162a8d..59f216cf1d 100644
--- a/Capfile
+++ b/Capfile
@@ -2,10 +2,6 @@
require 'dotenv'
Dotenv.load
-# DataDog deployment events
-require "capistrano/datadog"
-set :datadog_api_key, "5a2b3ffdb12de3ae0f25b12610457dbb"
-
# Load DSL and set up stages
require 'capistrano/setup'
diff --git a/Gemfile b/Gemfile
index 9815b9e800..805715ef84 100644
--- a/Gemfile
+++ b/Gemfile
@@ -107,7 +107,6 @@ group :development do
gem 'webrick', '1.3.1'
gem 'jslint_on_rails'
gem 'git_pretty_accept'
- gem 'dogapi', '>= 1.3.0'
end
group :test, :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index 6a016d18ff..b9867a8df1 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -165,8 +165,6 @@ GEM
warden (~> 1.2.3)
diff-lcs (1.1.3)
docile (1.1.5)
- dogapi (1.21.0)
- multi_json
domain_name (0.5.20160216)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.0.1)
diff --git a/vendor/cache/dogapi-1.21.0.gem b/vendor/cache/dogapi-1.21.0.gem
deleted file mode 100644
index d62821a3d973af712406c07cc8e05125251c3122..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 35840
zcmeFXQ;;r95H_~9ZQHhOpS5k
zy85v*b2TzGay4SG@CN$7N|^o=Ha0e(|5^Vh|D$GMVPywmX5nCF<7DFCVE=C(GbX#L78&$MAOVP*qM5dW3}r{$*jP&a;t+^
z`Lu&Lpv*!4`NJ1e#ka{U9eZZW6>BSXsdY{ob5a+_(Wh}}vBg^~t2BSx`4Vd#g2@co
z4YBjYV(6agS}^~{VOh#*N^|4<{3K9SV6ewiF5QhTO}v|;C{knr5-o7!*d_2+wb%!p9|zvUng`T~ZswyI??x)SOX3mmSw;&MuI?oL_rnp(=zUu!
zc(d_{E!Ws3(k>*l^?^ZJAmBkNg*~Oig1$mi@__Qm_a)7}7RGf0f9F)b=dOlG@+m0u
z$j%x-iY`|-Fr}VT2K`O{viAg?%{?6lWSx!?TISKd{y~pr%s-|C%L_5eURwpt;9`Gm
zF~Fc0ZEdtdk)#mt3qTeY?{GZnF24@PF!Ub}>F$=#{7cdfx~kcUr1`8@AIJ;4__2w=
zPHx{do*Xle#c)>fuiz|dZ-|~t2FBitxREsOTM5@T=3v1XN~UctyRKb&HO=wpA7{ng
z?3qIVx8h&Ch<0}iq=H@j+?hSSnYZo(sCtWP6m44-p%Xr0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