Skip to content
This repository

Fix for Issue #1306 - More insightful PaperTrail info #1329

Merged
merged 5 commits into from over 1 year ago

2 participants

jorgeramos Benoit Bénézech
jorgeramos

Makes use of PaperTrail's Version's change set to provide more insight into what changed from one version to the next.

jorgeramos Fix for Issue #1306
Makes use of PaperTrail's Version's change set to provide more insight into what changed from one version to the next.
7275ebd
Benoit Bénézech
Collaborator

Can you spec it a bit? Doesn't it break the base history plug-in? Does its auditing-adapter have a #change ?

added some commits September 30, 2012
jorgeramos Fix for Issue #1306
Makes use of PaperTrail's Version's change set to provide more insight into what changed from one version to the next.
73934ab
jorgeramos Merge branch 'master' of git://github.com/sferik/rails_admin into pap…
…er-trail-changeset
a893cb5
jorgeramos Merge branch 'master' of https://github.com/jorgeramos/rails_admin in…
…to paper-trail-changeset

Conflicts:
	lib/rails_admin/extensions/paper_trail/auditing_adapter.rb
734b9ca
jorgeramos

Hi, I edited the fix so it doesn't break the base history plug-in and it no longer has a #change method.

jorgeramos

Hello Benoit, let me know if there are any other changes I need to make so this can be added into the master branch.

Benoit Bénézech
Collaborator

Hi, If you look at the diff, https://github.com/sferik/rails_admin/pull/1329/files, you can see you are still calling object#changes. Is it intentional?

Spec coverage is spotty in this area.

jorgeramos

Benoit, there should only now be a single file with changes. See updated changelog...

Benoit Bénézech bbenezech merged commit a927d6c into from October 12, 2012
Benoit Bénézech bbenezech closed this October 12, 2012
Benoit Bénézech
Collaborator

Thanks !

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

Showing 5 unique commits by 1 author.

Sep 24, 2012
jorgeramos Fix for Issue #1306
Makes use of PaperTrail's Version's change set to provide more insight into what changed from one version to the next.
7275ebd
Sep 30, 2012
jorgeramos Fix for Issue #1306
Makes use of PaperTrail's Version's change set to provide more insight into what changed from one version to the next.
73934ab
jorgeramos Merge branch 'master' of git://github.com/sferik/rails_admin into pap…
…er-trail-changeset
a893cb5
jorgeramos Merge branch 'master' of https://github.com/jorgeramos/rails_admin in…
…to paper-trail-changeset

Conflicts:
	lib/rails_admin/extensions/paper_trail/auditing_adapter.rb
734b9ca
Oct 12, 2012
jorgeramos Remove unnecessary call to object.changes. Keeping everything as orig…
…inally designed
b540212
This page is out of date. Refresh to see the latest.
3  lib/rails_admin/extensions/paper_trail/auditing_adapter.rb
@@ -8,7 +8,8 @@ def initialize(version, user_class = User)
8 8
         end
9 9
 
10 10
         def message
11  
-          "#{@version.event} #{@version.item_type} id #{@version.item_id}"
  11
+          @message = "#{@version.event} #{@version.item_type} ID #{@version.item_id}"
  12
+          @version.respond_to?(:changeset) ? @message + " [" + @version.changeset.to_a.collect {|c| c[0] + " = " + c[1][1].to_s}.join(", ") + "]" : @message
12 13
         end
13 14
 
14 15
         def created_at
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.