I'm using Ransack's sort_link in my rails project to display a list of fees for my payment model. However, 'fee_amount' isn't an attribute of the payment model, but instead a class method of the bill model (which belongs to payment). What I have currently is:
<%= sort_link @search, :bill_fee_amount, "Convenience Fee" %>
which should accesses the bill of the current payment and call the 'fee_amount' method on that bill, which does some calculations and returns a float. It's these floats that I'm hoping to search by.
Can this be done, or can I only sort by attributes of the model I'm dealing with?