Skip to content

Ruby: remove public abstract classes for Action{View,Controller}#10673

Merged
nickrolfe merged 6 commits into
mainfrom
nickrolfe/no_abstract
Oct 4, 2022
Merged

Ruby: remove public abstract classes for Action{View,Controller}#10673
nickrolfe merged 6 commits into
mainfrom
nickrolfe/no_abstract

Conversation

@nickrolfe

Copy link
Copy Markdown
Contributor

Most of these were abstract because we provide separate implementations for calls in the context of ActionView and ActionController. In those cases, I've moved the public-facing class to Rails.qll, introduced Impl (range) classes for them in internal/Rails.qll, and kept the Impl subclasses as private classes in the appropriate ActionView.qll and ActionController.qll file.

I've also moved the this.getMethodName() = ... restrictions out of the base class charpreds and into the individual implementation charpreds. This adds a little more duplication, but I have a reason for doing it: when I add ActionMailer support, I'll want a call to mail to be considered a RenderCall, so this.getMethodName() = "render" in the base class would not work.

@github-actions github-actions Bot added the Ruby label Oct 4, 2022
@nickrolfe nickrolfe marked this pull request as ready for review October 4, 2022 11:36
@nickrolfe nickrolfe requested a review from a team as a code owner October 4, 2022 11:36

@alexrford alexrford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this - just a question around the deprecation policy.

Comment thread ruby/ql/lib/codeql/ruby/frameworks/ActionController.qll

@alexrford alexrford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants