ransack
ransack copied to clipboard
Add the ability to combine aliases
#623 added ransack aliases, so long query strings like owner_first_name_or_owner_last_name can be shortened to owner. This feature is great, but it'd be even better if we could combine those aliases with _or_ like any other query string.
Example:
class Post < ApplicationRecord
ransack_alias :owner, :owner_first_name_or_owner_last_name
ransack_alias :approver, :approver_first_name_or_approver_last_name
end
Post.ransack(owner_or_approver_cont: "Bob")
Thank you @dkniffin. Any chance of writing a test against this feature? Just submit a PR with the tests only and refer this issue. It will help someone code it. Cheers.