ransack icon indicating copy to clipboard operation
ransack copied to clipboard

Add the ability to combine aliases

Open dkniffin opened this issue 8 years ago • 1 comments

#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")

dkniffin avatar Nov 29 '17 17:11 dkniffin

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.

scarroll32 avatar Feb 28 '18 19:02 scarroll32