plataformatec/simple_form — pull request #820 by blakink (2013-06-06 16:44:08+00:00)
Title: Don't load association collection until needed

Hi,

I was creating a custom collection input, when I figured that the collection passed to the input object is already an array.

Passing a AR::Relation (or any other ORM relation) instead of an array will prevent loading the whole table before rendering the input.

In my case, I'm building an input with autocompletion. I need the ``CollectionInput`` design, but not loading the whole table.

It should not affect default inputs provided by simple_form : to_a will be called in ``SimpleForm::Inputs::CollectionInput # collection ``

The patch is really tiny, and all tests passed.