sferik/rails_admin — Issue #852: default_scope breaks ajax autocomplete for models with more than 100 records
Author: lukesteensen
Created: 2011-11-24 10:51:59+00:00
State: open

I'm working in the rails-3.0 branch, so I'm not sure if this has been addressed upstream.

Given the following models:

```ruby
class Field < ActiveRecord::Base
has_many :subfields
default_scope order(:name)
end

class Subfield < ActiveRecord::Base
belongs_to :field
end
```

When editing a `Subfield` record in rails_admin, the `belongs_to` association is presented as an ajax autocomplete dropdown type thing. It correctly fetches and displays `Field`s as options when there are less than 100 total records in the database, as expected.

When the total number of `Field`s surpasses 100, however, only the first 20 of them are correctly fetched and presented as options. The rest are inaccessible from the form.

When the `default_scope` is removed, the system works as expected with any number of records.