You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
We recently switched our app to Rails 6(6.1.2) and we noticed that only_deleted and with_deleted scopes doesn't work properly via associations
class User < ApplicationRecord
acts_as_paranoid
belongs_to :company
end
class Company < ApplicationRecord
acts_as_paranoid
has_many :users
end
c = Company.find 1
c.users.only_deleted.count
generates sql:
SELECT COUNT() FROM "users" WHERE "users"."deleted_at" IS NOT NULL
expecting sql:
SELECT COUNT() FROM "users" WHERE "users"."company_id" = $1 AND "users"."deleted_at" IS NOT NULL
The text was updated successfully, but these errors were encountered:
Hi!
We recently switched our app to Rails 6(6.1.2) and we noticed that only_deleted and with_deleted scopes doesn't work properly via associations
generates sql:
SELECT COUNT() FROM "users" WHERE "users"."deleted_at" IS NOT NULL
expecting sql:
SELECT COUNT() FROM "users" WHERE "users"."company_id" = $1 AND "users"."deleted_at" IS NOT NULL
The text was updated successfully, but these errors were encountered: