Merge [PR207](https://github.com/ernie/ransack/pull/207/files) by [jwg2s](https://github.com/jwg2s)

and some code cleanup