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
Whodunnit == User object? #522
Comments
You are suggesting adding a custom accessor on the |
Hey Ben, Here's how PublicActivity implements it: https://github.com/pokonski/public_activity/blob/master/lib/public_activity/orm/active_record/activity.rb#L12 |
Dan, I think you can accomplish this by implementing your own # app/models/paper_trail/version.rb
module PaperTrail
class Version < ActiveRecord::Base
include PaperTrail::VersionConcern
belongs_to :user, :polymorphic => true
end
end You'd store the I have some concerns about building this into
|
Dan, I'm going to close this, but please let me know if my suggestion doesn't work for you, and I'll be happy to reopen it. |
Great thoughts and notes @jaredbeck -- I really appreciate the feedback. I think that workaround will work, though it's a bit wordy (a few helper methods should solve that though). If you leave the association as a polymorphic one, then anyone can use the relationship for any reason. That should answer your questions 1,2,4. PublicActivity handles deleted records quite nicely, with the default recipe checking on |
I really like Audited's and PublicActivity's methods of tying to the user who performed the edit.. even if that user could eventually be deleted.
I think it would be beneficial if papertrail supported something more than a string. Essentially just a polymorphic association instead of just a single string.
The text was updated successfully, but these errors were encountered: