collectiveidea / audited

Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.
MIT License
3.39k stars 671 forks source link

Multiple associated audits #337

Open ryanwjackson opened 7 years ago

ryanwjackson commented 7 years ago

It would be good to have the ability to associate a model with multiple parent models. Something like the following:

class Mother < ActiveRecord::Base
  audited
  has_associated_audits
end

class Father < ActiveRecord::Base
  audited
  has_associated_audits
end

class Child < ActiveRecord::Base
  audited associated_with: [:mother, :father]
end
saygun commented 7 years ago

it would be great

ryanwjackson commented 7 years ago

I'm happy to work on a PR for this, but I think this would require some schema changes. And I have not contributed to a project that requires migration. If someone would be down to help, I'd love to add this functionality.

Any takers?

saygun commented 7 years ago

I might help you

gabrielms commented 7 years ago

Hey guys, i've made a pull request for that. https://github.com/collectiveidea/audited/pull/342

I'm not a experienced programmer, so if you guys could help me i would appreciate very much. :)

I've tested it on a project of mine, and it worked pretty well.

fatkodima commented 6 years ago

I have made a pull request for that - #406.

Kani999 commented 5 years ago

Any progress on this?