forked from rubocop/rubocop-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
Rails/FilePath
cop error in case of extra operations in `Rails.…
…root` interpolation Follow-up to rubocop#1392. Previous PR didn't fix cases like this ``` "#{Rails.root || '.'}/config" ``` (it makes sense in real code since `Rails.root` [can be nil](https://github.com/rails/rails/blob/main/railties/lib/rails.rb#L65-L67)) I think it's safe to simply check if the entire expression is of `send` type.
- Loading branch information
1 parent
c6f869b
commit e4aee6b
Showing
4 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...ix_rails_file_path_cop_error_on_extra_operations_in_rails_root_interpolation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#1398](https://github.com/rubocop/rubocop-rails/pull/1398): Fix `Rails/FilePath` cop error in case of extra operations in `Rails.root` interpolation. ([@viralpraxis][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters