Rails 5 introduces Array Inquirer that wraps an array object and provides friendlier methods to check for the presence of elements that can be either a string or a symbol. pets = ActiveSupport::ArrayInquirer.new([:cat, :dog, 'rabbit']) > pets.cat? #=> true > pets.rabbit? #=> true > pets.elephant? #=> false Array Inquirer also has any? method to check for the presence of any of the passed arguments
