Refactor instructions for initializer to automatically defer whodunnit value from shell [ci skip]
This commit is contained in:
parent
10d8451d70
commit
a9bb8ddf1b
12
README.md
12
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
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue