sferik/rails_admin — pull request #1428 by taavo (2012-12-06 18:08:45+00:00)
Title: Defer model loading

Fixes #1375, unless there's another issue there I don't understand.

```
RailsAdmin.config do
config 'Model' do
...configuration goes here...
end
end
```

Before this pull request the `...configuration goes here...` block is instance_evaluated immediately, which results in `Model` being loaded, even though we don't know if we need it yet.

After this pull request the `...configuration goes here...` block is saved for later, and instance_evaluated when we need it.

According to `spork -d`, my models are no longer being loaded inside the initializer, which is sweet.

Note that this trick is only relevant if you call config on `'Model'`, not `Model`, since the latter will immediately load the constant if missing. And I'm pretty new to hacking on rails_admin, so there might be a higher level way to fix this--I don't know.

Please let me know if there's anything I can do to improve this pull request. Thank you.