Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Migrate history to a plugin #1427

bamorim opened this Issue Dec 4, 2012 · 8 comments


None yet
3 participants

bamorim commented Dec 4, 2012

I'm thinking about that becouse If someone changes some admin email it will get harder to track his actions.

bamorim commented Dec 4, 2012

Or Maybe we can use a configuration field like RailsAdmin::Config.track_users_by_field


gunn commented Dec 4, 2012

Tracking by id sounds considerably more sane to me.


bbenezech commented Dec 5, 2012

Polymorphic association then. But if you need that, you can migrate to Papertrail for free. Not sure it's worth it.

bamorim commented Dec 5, 2012

Yeah, I really tought about migrating to Papertrail, but then I realized it's overkill.
I just wanted a cool history, not version control.


bbenezech commented Dec 6, 2012

Sure, I don't mind a polymorphic association for User. Then we should create a proper one for the modified object too (what this hasn't been done at the very first time is beyond me). This implies migrating the DB schema and data of all history users.

But this is really going to look like papertrail IMO. I'm even wondering if it is a good idea to keep history in RailsAdmin. It is ActiveRecord only (do we have smtg for Mongoid @mshibuya ?).

It should be extracted to a plugin. Then you would be able to fork it (and share it) to something a lot more usable. The API is ready for that.

bamorim commented Dec 6, 2012

Yeah, migrating the DB will be hard, because if some admin changed his email we would lost the track of his actions, since we wouldn't find an User with that old email.

So I agree with you, it's a nice idea extracting this to a plugin!


bbenezech commented Dec 7, 2012

ok, let's do this.

bamorim commented Dec 8, 2012

I have some suggestions for this plugin.
Today I was talking to my client (I'm planning to develop an application for him) and when I showed him the history of rails_admin, there was a deleted item, and the history was saying

Admin X | ModelName #item_id | Deleted

And he asked me: "How I would know what is that Item that was deleted?"

So my suggestion is that we keep two informations for the item: An ID and a Name. That name could be specified by a function model, and taking somthing like "name" or "to_s" as default.
So if the model is deleted, we show that name in the history, instead, we show a reference to the item.

Sorry for my bad english, but I think you can understand that.

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