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

Handling :dependent => :nullify #44

Open
JohnKacz opened this issue Mar 5, 2015 · 3 comments
Open

Handling :dependent => :nullify #44

JohnKacz opened this issue Mar 5, 2015 · 3 comments

Comments

@JohnKacz
Copy link

JohnKacz commented Mar 5, 2015

So looking at how revive_destroyed_dependent_records works it seems there is no way currently to restore the association to nullified dependents. Correct?

Could this be handled by checking for :nullify in get_dependent_records and then if the dependent class has a column dead_[association]id moving the id to to that column and then going ahead and nullifying the records? This would then follow that revive would look for the dead[association]_id column and reverse the operation.

@JackDanger
Copy link
Owner

@JohnKacz I think that's a good idea. Care to put together a PR?

@JohnKacz
Copy link
Author

Ya, as I was typing it out that was exactly my thought - this is more of a feature request which means I should probably fork and implement. sigh I'll see if I can make some time but I'm not the most git-savvy and I'll want to look through the current code base some more.

Thanks.

@JackDanger
Copy link
Owner

@JohnKacz You don't have to get it perfect. Just hit the 'fork' button and take a whack at it. Then you and I or anybody else who contributes here can help you figure out how to get things in the right shape. Glad to have your help!

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

No branches or pull requests

2 participants