From f8e2ecfa94deef1673b827807825e613dc9a1d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= <regis@hanol.fr> Date: Wed, 6 Nov 2013 11:43:40 +0100 Subject: [PATCH] keep track of the user who revised a post --- lib/post_revisor.rb | 1 + spec/components/post_revisor_spec.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/post_revisor.rb b/lib/post_revisor.rb index 9a4fac265a8..97e545c1ec2 100644 --- a/lib/post_revisor.rb +++ b/lib/post_revisor.rb @@ -12,6 +12,7 @@ class PostRevisor return false if not should_revise? @post.acting_user = @user + @post.updated_by = @user revise_post update_category_description post_process_post diff --git a/spec/components/post_revisor_spec.rb b/spec/components/post_revisor_spec.rb index e956cda09b4..4dadaa2f1cd 100644 --- a/spec/components/post_revisor_spec.rb +++ b/spec/components/post_revisor_spec.rb @@ -197,6 +197,11 @@ describe PostRevisor do it "allows an admin to insert images into a new user's post" do post.errors.should be_blank end + + it "marks the admin as the last updater" do + post.updated_by.should == changed_by + end + end describe "new user editing their own post" do