Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveRecord queries with includes now respect :with_deleted => true #37

Merged
merged 2 commits into from
Jul 8, 2016

Conversation

pelargir
Copy link
Contributor

This fixes issue #17 by ensuring :with_deleted => true is respected when using #includes and #joins in association queries. Hat tip to @tkupari for the original fix in goncalossilva/acts_as_paranoid#115

@zzak
Copy link
Contributor

zzak commented Nov 17, 2015

@pelargir The build failed, could you look into it?

@pelargir
Copy link
Contributor Author

@zzak There.

@alexggordon
Copy link

@zzak @pelargir what's the status on this? Can we get this merged?

@pelargir
Copy link
Contributor Author

@alexggordon still ready to be merged as far as I'm concerned.

@vellotis
Copy link

vellotis commented Jul 5, 2016

Works great! Regards @pelargir

@zzak I know this project isn't actively used any more. But this PR gives a great improvement. Could you please at least merge it? Publishing a gem would also be welcome.

@zzak
Copy link
Contributor

zzak commented Jul 5, 2016

@vellotis Thanks for the feedback!

I'm hoping to get around to this soon, sorry for such a long delay~

@vellotis
Copy link

vellotis commented Jul 5, 2016

@zzak Great to hear!

@zzak zzak closed this Jul 7, 2016
@zzak zzak reopened this Jul 7, 2016
@zzak zzak added this to the 0.5.0.rc1 milestone Jul 7, 2016
@zzak
Copy link
Contributor

zzak commented Jul 7, 2016

Needs a rebase

@zzak zzak merged commit 1a5ef3a into ActsAsParanoid:master Jul 8, 2016
@zzak
Copy link
Contributor

zzak commented Jul 8, 2016

@pelargir Thank you!!

@vellotis Merged!

Thanks everyone for your patience <3

@vellotis
Copy link

vellotis commented Jul 8, 2016

My best regards! @zzak

@btrscott
Copy link

Doesn't seem to be working for me. Still including the: AND driver.deleted_at IS NULL in the sql that filters out the records when the associated field is deleted

Using
belongs_to :driver, with_deleted: true

Want to bring up the parent record even though the driver is deleted.

Can anyone confirm the fix works for them? Using 0.5.0 gem.

@btrscott
Copy link

@zzak This does not seem to be working for me still. Are you sure this is fixed?

@lordplagus02
Copy link

lordplagus02 commented Nov 6, 2018

This doesn't actually seem to be fixed, have tried many combinations of scopes and with_deleted. Also does not allow you to do something like belongs_to :model, through: :parent_model, with_deleted: true

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

Successfully merging this pull request may close these issues.

None yet

8 participants