class Ransack::Predicate

def detect_from_string(str)

def detect_from_string(str)
  names_by_decreasing_length.detect { |p| str.end_with?("_#{p}") }
end