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

paper_trail restore relations #5

Open
nicolasfranck opened this issue Aug 6, 2015 · 3 comments
Open

paper_trail restore relations #5

nicolasfranck opened this issue Aug 6, 2015 · 3 comments

Comments

@nicolasfranck
Copy link

Thanks for this great module!

The newest paper_trail makes it possible to restore relations (has_one and has_many),
but you need to supply the options ":has_many => true, :has_one => true" to the method
"reify" to make this possible:

https://github.com/airblade/paper_trail#associations

This to ensure backward compatibility, and not to confuse/enrage simple users.

Would it be interesting to add an extra button to restore also these associations?
For example "rollback (including assocations)"

@rikkipitt
Copy link
Member

Hi @nicolasfranck thanks for your feedback, really appreciated. Your idea sounds great, do you have a set up you'd be able to test this on? It would be awesome if you could help contribute this new feature to the module. Fancy submitting a pull request?

Cheers,

Rikki

@nicolasfranck
Copy link
Author

I'm working on it. But it's more complicating than you think.

When you only remove/add a relation, and change nothing
to the parent record, there is no new version of this parent record.
So no new version appears in history index, you can use as a reference.
It works if you update both parent record and relations.

I'll notify you

@rikkipitt
Copy link
Member

Hey @nicolasfranck, it's tricky indeed. When I get a spare moment, I'll take a look into it too. I'm sure between us we can figure it out. I'll create a branch for it soon so we can test it all works.

Rikki

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

No branches or pull requests

2 participants