You can declare your own ransacker in the model as follows:
ransacker :status, formatter: proc {|v| statuses[v]} do |parent| parent.table[:status] end
You can then use the default _eq syntax _eq to _eq for equality as follows:
Model.ransack(status_eq: 'active').result
Edit: if the column name does not change, you can skip the code block:
ransacker :status, formatter: proc {|v| statuses[v]}
qarol source share