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

activeadmin / activeadmin / 5127
79%

Build:
DEFAULT BRANCH: master
Ran 16 Nov 2016 03:33PM UTC
Jobs 5
Files 142
Run time 11min
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
5127

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

4 of 4 new or added lines in 1 file covered. (100.0%)

3199 of 3940 relevant lines covered (81.19%)

46.35 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
lib/active_admin/filters/forms.rb
Jobs
ID Job ID Ran Files Coverage
3 5127.3 (2.3.0, RAILS=3.2.22) 16 Nov 2016 03:33PM UTC 0
81.12
Travis Job 5127.3
4 5127.4 (2.3.0, RAILS=4.2.5) 16 Nov 2016 03:37PM UTC 0
81.22
Travis Job 5127.4
5 5127.5 (2.3.0, RAILS=5.0.0) 16 Nov 2016 03:35PM UTC 0
81.22
Travis Job 5127.5
6 5127.6 (jruby-9.0.5.0, RAILS=3.2.22) 16 Nov 2016 03:43PM UTC 0
80.94
Travis Job 5127.6
7 5127.7 (jruby-9.0.5.0, RAILS=4.2.5) 16 Nov 2016 03:45PM UTC 0
81.18
Travis Job 5127.7
Source Files on build 5127
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5127
  • Pull Request #4666
  • PR Base - master (#5122)
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