Skip to content

Commit

Permalink
fix: treat @report.answer_to('genus_parts') as array
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph-Burke committed Mar 18, 2022
1 parent 14993e7 commit 73cd626
Show file tree
Hide file tree
Showing 4 changed files with 1,943 additions and 27 deletions.
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# confirmation, reset password and unlock tokens in the database.
# Devise will use the `secret_key_base` as its `secret_key`
# by default. You can change it below and use your own secret key.
# config.secret_key = '84a336e50ca9f36f1d79c2aaba6486f80f653fca3198ddcde62eddb81ffaf67e7f4c660c074c1650281d41f34e943b8e138a38f1b1ca902b51259e8fe000a298'
config.secret_key = 'c9b7b69241ee395fd117050cec7d966b06a70553c56f7eb73d47e72fd83c57146d9b5f9195c553df7814484a40e7941d3cfffb95734b21bc40c6b3dd2a2341e1'

# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
Expand Down
Binary file added dump.rdb
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/modules/csv_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def answer_body_part part, value, float=false
Body parts data need a genus to be specified.
Do you have a "Body Parts Genus (Ape)" column in your CSV?
ERROR
genus_name = @report.answer_to("genus_parts") or raise CsvConversionError, error_message
genus_name = @report.answer_to("genus_parts")[0] or raise CsvConversionError, error_message
question_name = "parts_#{find_genus(genus_name)}"

selected = @report.answer_to(question_name) || {"parts" => {}}
Expand Down Expand Up @@ -127,6 +127,7 @@ def find_genus value
"Dead Identifiers" => proc { |value| answer("unique_identifiers_dead", value, "dead") },
"Dead Name" => proc { |value| answer("individual_name_dead", value, "dead") },
"Body Parts (Genus)" => proc { |value|
# THE ISSUE WE HAVE IS THAT THE INDIVIDUAL REPORT FORM ALLOWS A
answer("genus_parts", [value])
add_genus(value, "parts")
},
Expand Down
Loading

0 comments on commit 73cd626

Please sign in to comment.