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
Backporting #2226 to 3.0 stable #2759
Conversation
Allows the generation of URLs of deleted models. Makes it easier to create a list of trashed models (a.k.a Trash view). Helps me with #2226. Signed-off-by: Mario Uher <uher.mario@gmail.com>
Extention for #2226.
OK, I have better solution for this. Will be pull requested in moment. |
OK, I think this is enough for backport to 3.0. But I have different idea. We should redefine like this: def persisted?
paranoid ? (!new_record?) : (!new_record? && !destroyed?)
end After we can remove this from def to_param
new_record? ? nil : to_key.join('-')
end Because I think it's true that object is persisted when it's deleted and some methods like |
I've pulled the commit from #2226 back into the 3.0.0-stable. As for the other changes I'll have a closer look for 3.1. |
I see only one commit in 3.0 stable. But another one is needed also @durran. |
And for that improvement for Paranoia. I was heavily inspired by this solution (https://github.com/radar/paranoia/blob/master/lib/paranoia.rb). |
Yeah I think that gem will be the way to go - I probably won't be doing much work work in this area being close to the 3.1 release at the moment, also given that we are removing it in 4.0. |
@durran ok, thanks. Should I decouple paranoia in separate gem? I'm really interested in it now. |
@simi That would be great! It definitely would be nice to have some love around it. |
@durran I decoupled it https://github.com/simi/mongoid-paranoia. |
Hello. I have similar problem (https://github.com/mongoid/mongoid/issues/2226).
Any chance to get this backported to 3.0 and release new version?
Thanks, Josef