class ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder

def handle_model(record)

def handle_model(record)
  args  = []
  model = record.to_model
  named_route = if model.persisted?
                  args << model
                  get_method_for_string model.model_name.singular_route_key
                else
                  get_method_for_class model
                end
  [named_route, args]
end