Closed nimmolo closed 3 months ago
`RuntimeError in ObservationsController#index Don't know how to join from observations to field_slips. Extracted source (around line #265): from, to = to, from else raise("Don't know how to join from #{from} to #{to}.") end
# By default source table column is just "id"; enter both target and
Rails.root: /Users/nathan/src/mushroom-observer
Application Trace | Framework Trace | Full Trace app/classes/query/modules/joining.rb:265:in `calc_join_condition' app/classes/query/modules/sql.rb:123:in `calc_join_conditions' app/classes/query/modules/sql.rb:121:in `block in calc_join_conditions' app/classes/query/modules/sql.rb:121:in `map' app/classes/query/modules/sql.rb:121:in `calc_join_conditions' app/classes/query/modules/sql.rb:74:in `calc_from_clause' app/classes/query/modules/sql.rb:25:in `query' app/classes/query/modules/low_level_queries.rb:35:in `select_values' app/classes/query/modules/high_level_queries.rb:56:in `result_ids' app/classes/query/modules/high_level_queries.rb:36:in `num_results' app/controllers/application_controller.rb:1437:in `set_index_view_ivars' app/controllers/application_controller.rb:1399:in `show_index_setup' app/controllers/application_controller.rb:1375:in `show_index_of_objects' app/controllers/observations_controller/index.rb:189:in `show_selected_observations' app/controllers/observations_controller/index.rb:131:in `render_pattern_search_results' app/controllers/observations_controller/index.rb:117:in `pattern' app/controllers/application_controller.rb:1335:in `block in index' app/controllers/application_controller.rb:1333:in `each' app/controllers/application_controller.rb:1333:in `index' app/controllers/application_controller.rb:226:in `catch_errors_and_log_request_stats'
Working better. This PR should target main now that njw-field-slip-pdfs has merged.
Even after merging in main locally this PR is failing a lot of tests. I haven't dug into why.
@mo-nathan — @pellaea spotted the problem.
My query method needed a guard clause so it only gets applied if there IS a field_slip param.
Allows users to type this in the search field and get back the relevant observation:
field_slip:ATEST-0001