gregbell/active_admin — Issue #892: [BUG] When using scope for filters
Author: cj
Created: 2012-01-03 22:39:40+00:00
State: open

If you do this in your model

```
belongs_to :ccc_assignment_head, :class_name => "Asn::CccAssignmentHead"

search_methods :claim_id

scope :claim_id, lambda { |claim_id|
joins(:ccc_assignment_head).where("ccc_assignment_head.claim_id=?", claim_id)
}

```

Then `filter :claim_id, as: :string, label: 'Claim ID'` activeadmin just hangs and will no load.

If you do `filter :claim_id, as: :number, label: 'Claim ID'` it works and shows you the filter. But it adds extra formatting including `required` which shouldn't be there:
![](http://content.screencast.com/users/brainyone/folders/Jing/media/b06f3c7e-26d9-4815-a662-628137bbb8e0/00001419.png)