lib/db_mod/statements/configuration/single.rb
Freeze mutable objects assigned to constants. Open
Open
COERCERS = {
value: Single::Value,
value!: Single::RequiredValue,
row: Single::Row,
row!: Single::RequiredRow,
- Read upRead up
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Example:
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze