Skip to content

Remove redundant unscope from assocation

Thong Kuah requested to merge remove_redundant_unscope into master

What does this MR do?

Remove redundant unscope from assocation

There has been no default_scope on project since 8e8eb978.

See also https://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-unscope

unscope(*args) undoes previous scopes that match. So if we no longer have a default_scope related to pending_delete, unscope(where: :pending_delete) is doing nothing

[1] pry(main)> Project.unscope(where: :pending_delete).to_sql
=> "SELECT \"projects\".* FROM \"projects\""
[2] pry(main)> Project.where(pending_delete: false).unscope(where: :pending_delete).to_sql
=> "SELECT \"projects\".* FROM \"projects\""

Merge request reports

Loading