Commit c30adbfcd512a0904d6266ff8003eae02275561b
1 parent
f1f39cdc
Exists in
master
and in
1 other branch
Rubocop: fix uses of "and"
Notice the return value of a before_action is ignored, so we can safely remove that code.
Showing
3 changed files
with
2 additions
and
10 deletions
Show diff stats
.rubocop_todo.yml
@@ -104,14 +104,6 @@ Style/AlignParameters: | @@ -104,14 +104,6 @@ Style/AlignParameters: | ||
104 | - 'app/models/problem.rb' | 104 | - 'app/models/problem.rb' |
105 | - 'config/initializers/devise.rb' | 105 | - 'config/initializers/devise.rb' |
106 | 106 | ||
107 | -# Offense count: 2 | ||
108 | -# Cop supports --auto-correct. | ||
109 | -# Configuration parameters: EnforcedStyle, SupportedStyles. | ||
110 | -Style/AndOr: | ||
111 | - Exclude: | ||
112 | - - 'app/controllers/users_controller.rb' | ||
113 | - - 'app/models/error_report.rb' | ||
114 | - | ||
115 | # Offense count: 105 | 107 | # Offense count: 105 |
116 | # Cop supports --auto-correct. | 108 | # Cop supports --auto-correct. |
117 | # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. | 109 | # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. |
app/controllers/users_controller.rb
@@ -55,7 +55,7 @@ class UsersController < ApplicationController | @@ -55,7 +55,7 @@ class UsersController < ApplicationController | ||
55 | 55 | ||
56 | def require_user_edit_priviledges | 56 | def require_user_edit_priviledges |
57 | can_edit = current_user == user || current_user.admin? | 57 | can_edit = current_user == user || current_user.admin? |
58 | - redirect_to(root_path) and return(false) unless can_edit | 58 | + redirect_to(root_path) unless can_edit |
59 | end | 59 | end |
60 | 60 | ||
61 | def user_params | 61 | def user_params |
app/models/error_report.rb
@@ -94,7 +94,7 @@ class ErrorReport | @@ -94,7 +94,7 @@ class ErrorReport | ||
94 | 94 | ||
95 | # Launch all notification define on the app associate to this notice | 95 | # Launch all notification define on the app associate to this notice |
96 | def services_notification | 96 | def services_notification |
97 | - return true unless app.notification_service_configured? and should_notify? | 97 | + return true unless app.notification_service_configured? && should_notify? |
98 | app.notification_service.create_notification(problem) | 98 | app.notification_service.create_notification(problem) |
99 | rescue => e | 99 | rescue => e |
100 | HoptoadNotifier.notify(e) | 100 | HoptoadNotifier.notify(e) |