Skip to content

LiteralInCondition valid? #317

@lenntt

Description

@lenntt

Hi,

I noticed that the following code gives me the warning:

W: Literal 'index' appeared in a condition.

(params[:action] || 'index').to_sym

Im not sure what rubocop is suggesting here and how it matches with the ruby-style-guide. ??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions