A TypeError occurred in background at 2024-05-22 00:12:14 UTC :
no implicit conversion of String into Integer
/srv/rails/fairdomhub/app/models/sample.rb:145:in `[]'
-------------------------------
Backtrace:
-------------------------------
/srv/rails/fairdomhub/app/models/sample.rb:145:in `[]'
/srv/rails/fairdomhub/app/models/sample.rb:145:in `block (3 levels) in refresh_linking_samples'
/srv/rails/fairdomhub/app/models/sample.rb:144:in `each'
/srv/rails/fairdomhub/app/models/sample.rb:144:in `block (2 levels) in refresh_linking_samples'
/srv/rails/fairdomhub/app/models/sample.rb:142:in `each'
/srv/rails/fairdomhub/app/models/sample.rb:142:in `block in refresh_linking_samples'
/srv/rails/fairdomhub/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.7/lib/active_record/relation/delegation.rb:88:in `each'
/srv/rails/fairdomhub/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.7/lib/active_record/relation/delegation.rb:88:in `each'
/srv/rails/fairdomhub/app/models/sample.rb:138:in `refresh_linking_samples'
seems to be encountering an array instead of hash, and maybe related to multiple linked samples - but I've not yet been able to reproduce. Might be caused by being registered through the API
error occuring:
offending line https://github.com/seek4science/seek/blob/main/app/models/sample.rb#L145
I think with
if sample['id'] == id
, one is a String and the other and Integer, so needs converting