I want to fix the current class as existing when exit from some current class.
For this nested situation, current class is set to nil. But, that can exists: wrapping class.
Background
My team encountered the situation like a below example.
In the UsersController class,
when we set UnexpectedError class definition above the create action, we warned about RestrictAutoGeneratedRoutesCheck . I think the create action was not recognized.
But
when we set UnexpectedError class definition below the create action, we were not warned.
Rails.application.routes.draw do
resources 'users', :only=> [:create]
end
class UsersController < ApplicationController
class UnexpectedError < StandardError; end # restrict auto-generated routes users (only: [])
def create; end
end
class UsersController < ApplicationController
def create; end
class UnexpectedError < StandardError; end # no warning
end
Motivation
I want to fix the current class as existing when exit from some current class.
For this nested situation, current class is set to nil. But, that can exists: wrapping class.
Background
My team encountered the situation like a below example.
In the
UsersController
class,when we set
UnexpectedError
class definition above the create action, we warned aboutRestrictAutoGeneratedRoutesCheck
. I think the create action was not recognized.But when we set
UnexpectedError
class definition below the create action, we were not warned.