• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MushroomObserver / mushroom-observer / 26446274721
96%

Build:
DEFAULT BRANCH: main
Ran 26 May 2026 10:20AM UTC
Jobs 1
Files 1009
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
26446274721

push

github

web-flow
Fix #4360: cross-model q param falls back to unfiltered index (#4363)

`ApplicationController::Queries#find_new_query_for_model` only
returned the old query when its model matched the target — and nil
otherwise. The caller then created a fresh default query, which
silently rendered the *unfiltered* index.

So a URL like `/images?q[model]=Observation&q[pattern]=Foo` —
legitimate cross-model search produced by MO's search links —
silently rendered the full Image index when no Observations
matched. A >60-second response that could trigger downtime alerts.

The model bridge already exists: `Query::Modules::Subqueries#current_or_related_query`
(and the `subquery_of` instance method on Query) maps a query from
one model to another via a related-queries table. For example an
Observation query becomes an Image query with
`observation_query: { pattern: "Foo" }`. The image query then
joins to observations and naturally returns 0 rows when no
observations match.

This commit just wires that bridge in — three lines in
`find_new_query_for_model`. No new infrastructure.

Regression tests in `images_controller_test.rb` cover both
branches:

- `test_index_cross_model_q_param_with_hits` — Observation pattern
  "USA" → bridges to Image query → hits, no flash.
- `test_index_cross_model_q_param_no_hits_flashes_error` —
  Observation pattern "nothingMatchesAxotl" → 0 observations → 0
  images → "no matches" flash. No silent fall-back to unfiltered.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

39004 of 40452 relevant lines covered (96.42%)

665.25 hits per line

Jobs
ID Job ID Ran Files Coverage
1 26446274721.1 26 May 2026 10:20AM UTC 1009
96.42
GitHub Action Run
Source Files on build 26446274721
  • Tree
  • List 1009
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26446274721
  • 8b035c62 on github
  • Prev Build on main (#26446270247)
  • Next Build on main (#26459747281)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc