Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update terminology in http_status.rb #6466

Merged
merged 1 commit into from
Nov 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/rubocop/cop/rails/http_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ class NumericStyleChecker
'to define HTTP status code.'.freeze
DEFAULT_MSG = 'Prefer `numeric` over `symbolic` ' \
'to define HTTP status code.'.freeze
WHITELIST_STATUS = %i[error success missing redirect].freeze
PERMITTED_STATUS = %i[error success missing redirect].freeze

attr_reader :node
def initialize(node)
@node = node
end

def offensive?
!node.int_type? && !whitelisted_symbol?
!node.int_type? && !permitted_symbol?
end

def message
Expand All @@ -176,8 +176,8 @@ def symbol
node.value
end

def whitelisted_symbol?
node.sym_type? && WHITELIST_STATUS.include?(node.value)
def permitted_symbol?
node.sym_type? && PERMITTED_STATUS.include?(node.value)
end
end
end
Expand Down