Created by: alzapiedi
I am using Field::BelongsTo.with_options and noticed on the edit page that it will always populate the drop down field with every model from the whole DB. In my application there are certain cases where we want the drop down to only display some models, so I made a slight tweak to the gem that I think could be helpful to others.
Field::BelongsTo.with_options(class_name: "Model", limit: { foo: "bar" })
will now populate the dropdown with the result of Model.where(foo: "bar")