@@ -90,7 +90,7 @@ module ActionDispatch {
90
90
* The zeroth parent is this block, the first parent is the direct parent of this block, etc.
91
91
*/
92
92
RouteBlock getParent ( int n ) {
93
- if n = 0 then result = this else result = getParent ( ) .getParent ( n - 1 )
93
+ if n = 0 then result = this else result = this . getParent ( ) .getParent ( n - 1 )
94
94
}
95
95
96
96
/**
@@ -302,9 +302,9 @@ module ActionDispatch {
302
302
303
303
override Stmt getAStmt ( ) { result = block .getAStmt ( ) }
304
304
305
- override string getPathComponent ( ) { result = getNamespace ( ) }
305
+ override string getPathComponent ( ) { result = this . getNamespace ( ) }
306
306
307
- override string getControllerComponent ( ) { result = getNamespace ( ) }
307
+ override string getControllerComponent ( ) { result = this . getNamespace ( ) }
308
308
309
309
private string getNamespace ( ) { result = call .getArgument ( 0 ) .getValueText ( ) }
310
310
@@ -407,8 +407,8 @@ module ActionDispatch {
407
407
*/
408
408
string getControllerComponent ( int n ) {
409
409
if n = 0
410
- then result = getLastControllerComponent ( )
411
- else result = getParentBlock ( ) .getParent ( n - 1 ) .getControllerComponent ( )
410
+ then result = this . getLastControllerComponent ( )
411
+ else result = this . getParentBlock ( ) .getParent ( n - 1 ) .getControllerComponent ( )
412
412
}
413
413
414
414
/**
@@ -417,9 +417,9 @@ module ActionDispatch {
417
417
string getController ( ) {
418
418
result =
419
419
concat ( int n |
420
- getControllerComponent ( n ) != ""
420
+ this . getControllerComponent ( n ) != ""
421
421
|
422
- getControllerComponent ( n ) , "/" order by n desc
422
+ this . getControllerComponent ( n ) , "/" order by n desc
423
423
)
424
424
}
425
425
@@ -456,8 +456,8 @@ module ActionDispatch {
456
456
*/
457
457
string getPathComponent ( int n ) {
458
458
if n = 0
459
- then result = getLastPathComponent ( )
460
- else result = getParentBlock ( ) .getParent ( n - 1 ) .getPathComponent ( )
459
+ then result = this . getLastPathComponent ( )
460
+ else result = this . getParentBlock ( ) .getParent ( n - 1 ) .getPathComponent ( )
461
461
}
462
462
463
463
/**
@@ -466,10 +466,10 @@ module ActionDispatch {
466
466
string getPath ( ) {
467
467
result =
468
468
concat ( int n |
469
- getPathComponent ( n ) != ""
469
+ this . getPathComponent ( n ) != ""
470
470
|
471
471
// Strip leading and trailing slashes from each path component before combining
472
- stripSlashes ( getPathComponent ( n ) ) , "/" order by n desc
472
+ stripSlashes ( this . getPathComponent ( n ) ) , "/" order by n desc
473
473
)
474
474
}
475
475
@@ -483,7 +483,7 @@ module ActionDispatch {
483
483
* We don't currently make use of this, but it may be useful in future to more accurately
484
484
* model the contents of the `params` hash.
485
485
*/
486
- string getACapture ( ) { result = getPathComponent ( _) .regexpFind ( ":[^:/]+" , _, _) }
486
+ string getACapture ( ) { result = this . getPathComponent ( _) .regexpFind ( ":[^:/]+" , _, _) }
487
487
}
488
488
489
489
/**
@@ -805,7 +805,7 @@ module ActionDispatch {
805
805
private string singularize ( string input ) {
806
806
exists ( string prefix | prefix = input .regexpCapture ( "(.*)ies" , 1 ) | result = prefix + "y" )
807
807
or
808
- not input .regexpMatch ( ".* ies") and
808
+ not input .matches ( "% ies") and
809
809
exists ( string prefix | prefix = input .regexpCapture ( "(.*)s" , 1 ) | result = prefix )
810
810
or
811
811
not input .regexpMatch ( ".*(ies|s)" ) and result = input
0 commit comments