activerecord-hackery/ransack — pull request #441 by caleb (2014-10-07 03:40:59+00:00)
Title: Fix link label generation in sort_link when an options has is not passed

This fixes the bug introduced by #438 talked about in that thread.

Not passing an options hash into sort_link caused it to fail to look up the link title.

This is because `!args.first.try(:is_a?, Hash)` would return true if the length of args was 0.

I've simplified the logic to just test if the next parameter in args is a String (rather than test if it's not a Hash).

I haven't created a test for this, since the tests all pass in an options hash (to pass in the `controller` parameter), but I wanted to make sure this works for you.

I tested it on a project I'm working on, and this patch fixed the problem that you were experiencing.