From a9bb8ddf1b9c92e89a5a08e2c48d228c76aad343 Mon Sep 17 00:00:00 2001 From: Ben Atkins Date: Wed, 12 Mar 2014 09:53:17 -0400 Subject: [PATCH] Refactor instructions for initializer to automatically defer whodunnit value from shell [ci skip] --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a2e19014..7198ed9d 100644 --- a/README.md +++ b/README.md @@ -481,14 +481,10 @@ You can avoid having to do this manually by setting your initializer to pick up ```ruby # config/initializers/paper_trail.rb -module PaperTrail - class Version < ActiveRecord::Base - if defined?(::Rails::Console) - PaperTrail.whodunnit = "#{`whoami`.strip}: console" - elsif File.basename($0) == "rake" - PaperTrail.whodunnit = "#{`whoami`.strip}: rake #{ARGV.join ' '}" - end - end +if defined?(::Rails::Console) + PaperTrail.whodunnit = "#{`whoami`.strip}: console" +elsif File.basename($0) == "rake" + PaperTrail.whodunnit = "#{`whoami`.strip}: rake #{ARGV.join ' '}" end ```