Sorting by model method doesn't work
Created by: duncan-spencer
Unless I am missing something, if you define an attribute that is a dynamic method (for example that returns a string) on a model, the sort method has no effect because it can only run order by on an activerecord attribute or that references an attribute on another model.
Are there any ways to work around this by creating a custom field or a with_options
method like on the HasOne fields? Is there anything we could do using virtual attributes?