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

activeadmin / activeadmin / 5127 / 6
79%
master: 79%

Build:
DEFAULT BRANCH: master
Ran 16 Nov 2016 03:43PM UTC
Files 142
Run time 7s
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

16 Nov 2016 03:27PM UTC coverage: 80.942% (-0.02%) from 80.959%
jruby-9.0.5.0, RAILS=3.2.22

Pull #4666

travis-ci

web-flow
raise an error for bad filters instead of silently failing

Today I attempted to add a filter on a has-many-through association. The
UI was display nothing for my filter and AFAICS there was nothing
anywhere to tell me what the problem was.

After digging around I found that

    ActiveAdmin::Fitlers::FormBuilder#filter

simply fails quietly (returning nothing) if the type for a filter can't
be determined.

I have updated the method to raise an error instead.

Here is what failed for me (names changed):

I had this class:

```
    class Foo < ActiveRecord::Base
        has_many :bars, though: :something
    end
```

In the corresponding activeadmin resource I had this:

```
  filter :bars_id_in,
      collection: -> { Bar.all },
      as: :select, # <------- I needed to specify this
      multiple: true,
```

I needed to specify `:as`, but I had to dig into the code to figure this
out.

I have not written any specs for this. If this patch is "pre approved"
then I can write specs before you pull if desired.
Pull Request #4666: raise an error for bad filters instead of silently failing

3007 of 3715 relevant lines covered (80.94%)

9.25 hits per line

Source Files on job 5127.6 (jruby-9.0.5.0, RAILS=3.2.22)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5127
  • Travis Job 5127.6
  • 560f62d1 on github
  • Prev Job for jruby-9.0.5.0, RAILS=3.2.22 on master (#5122.6)
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