We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This question was raised in another thread, #14 (comment)
Is there any guide on migrating existing application from paper_trail to this gem?
The text was updated successfully, but these errors were encountered:
Seems to me that this should be easy to do. Disclaimer, I just whipped this up quickly, its totally untested.
class MyRecord has_snapshot_children do ... end end MyRecord.all.each do |record| record.versions.each do |version| ### Use whatever options are applicable here reified_record = version.reify( has_many: true, has_one: true, belongs_to: false, ) snapshot_identifier = "#{version.updated_at}" user = User.find(version.whodunnit) if version.whodunnit reified_record.create_snapshot( identifier: snapshot_identifier, user: user, metadata: { info: "Migrated from paper_trail-association_tracking" } ) end end
Sorry, something went wrong.
No branches or pull requests
This question was raised in another thread, #14 (comment)
The text was updated successfully, but these errors were encountered: