You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I add before_action callback in a child controller for an action that is defined in the parent controller, example:
class PostsController < ApplicationController
def update
logic
end
end
class StoriesController < PostsController
before_action :do_something, only: [:update]
end
I get the following recommendation: Rails/LexicallyScopedActionFilter: update is not explicitly defined on the class.
But if I change StoriesController to
class StoriesController < PostsController
before_action :do_something, only: [:update]
def update
super
end
end
Then I get Lint/UselessMethodDefinition: Useless method definition detected.
I'm not sure it would be possible to detect that the method is defined in a parent class
dvandersluis, jaredmoody, JunichiIto, fralps, Ayliane and 2 more