Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

False positive when using includes #41

Open
wrtsprt opened this issue Nov 7, 2019 · 0 comments
Open

False positive when using includes #41

wrtsprt opened this issue Nov 7, 2019 · 0 comments

Comments

@wrtsprt
Copy link

wrtsprt commented Nov 7, 2019

The following code detects a problem that isn't actually there:

  def change
    User.includes(:global_user).find_each do |user|
      #
    end
  end

Using ActiveRecord::Relation#each is unsafe!

When I remove the includes the error disappears.

(GlobalUser has_many Users).

Version: 0.0.7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant