This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
all_optionals_available_condition(prior_segments)
public
Return an if condition that is true if all the prior segments can be
generated. If there are no optional segments before this one, then nil is
returned.
# File actionpack/lib/action_controller/routing/segments.rb, line 55
def all_optionals_available_condition(prior_segments)
optional_locals = prior_segments.collect { |s| s.local_name if s.optional? && s.respond_to?(:local_name) }.compact
optional_locals.empty? ? nil : " if #{optional_locals * ' && '}"
end