Skip to content

Commit 3ee425c

Browse files
committed
Ruby: Identify ActionController::API
`ActionController::API < ActionController::Base` is a base controller class, so we should recognise it as such.
1 parent 32b775f commit 3ee425c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ private DataFlow::ConstRef actionControllerBaseClass() {
100100
// In Rails applications `ApplicationController` typically extends `ActionController::Base`, but we
101101
// treat it separately in case the `ApplicationController` definition is not in the database.
102102
DataFlow::getConstant("ActionController").getConstant("Base"),
103-
// ActionController::Metal technically doesn't contain all of the
103+
// ActionController::Metal and ActionController::API technically don't contain all of the
104104
// methods available in Base, such as those for rendering views.
105-
// However we prefer to be over-sensitive in this case in order to find
106-
// more results.
107-
DataFlow::getConstant("ActionController").getConstant("Metal")
105+
// However we prefer to be over-sensitive in this case in order to find more results.
106+
DataFlow::getConstant("ActionController").getConstant("Metal"),
107+
DataFlow::getConstant("ActionController").getConstant("API")
108108
]
109109
}
110110

0 commit comments

Comments
 (0)