Skip to content

Suggestion: Add description about Active Record redundant all #339

Closed
@masato-bkn

Description

@masato-bkn

I suggest to add description about Active Record redundant all.

I often come across all used as receiver of Active Record query methods.

# bad
User.all.order(:created_at)
User.all.find(id)
User.all.where(id: ids)

# good
User.order(:created_at)
User.find(id)
User.where(id: ids)

In these cases, the output is same with or without all, so I think it's redundant and could be removed.

If there's a positive reaction to this issue, I plan to submit a PR.

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