sferik/rails_admin — pull request #1630 by neilang (2013-05-02 05:00:28+00:00)
Title: Fixed issue with using numeric field types to store enums in postgres

If you are using PostgreSQL and have a DB column of type float to store an enum, an error will occur when using the search functionality.

This is how the field is setup:

```ruby
rails_admin do
...
field :points, :enum do
enum do
[['10 pts', 10.0], ['20 pts', 20.0]]
end
end

end
```

And this is the error returned when running a query in the list view: `ActionView::Template::Error (PG::Error: ERROR: invalid input syntax for type double precision: "query"`

It appears that the SQL that gets generated for the search assumes enums to be a string.

So this pull request changes the query builder to fallback to the database type for enum fields when constructing a query.