app/models/request.rb
%i
-literals should be delimited by [
and ]
. Open
Open
enum form_of_address: %i(mr mrs prefer_to_omit)
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Symbol with a boolean name - you probably meant to use true
. Open
Open
validates :number_of_participants, numericality: { only_integer: true, greater_than: 0 }, allow_nil: :true
- Read upRead up
- Exclude checks
This cop checks for :true
and :false
symbols.
In most cases it would be a typo.
Example:
# bad
:true
# good
true
Example:
# bad
:false
# good
false
%i
-literals should be delimited by [
and ]
. Open
Open
enum status: %i(open accepted declined) # per database declaration, the first value is default
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Symbol with a boolean name - you probably meant to use true
. Open
Open
validates :number_of_participants_with_previous_knowledge, numericality: { only_integer: true, greater_than_or_equal_to: 0 }, allow_nil: :true
- Read upRead up
- Exclude checks
This cop checks for :true
and :false
symbols.
In most cases it would be a typo.
Example:
# bad
:true
# good
true
Example:
# bad
:false
# good
false