mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Added PaperTrail console and rake users
This commit is contained in:
parent
14edac7b4e
commit
e7405f7df4
1 changed files with 4 additions and 4 deletions
|
@ -6,9 +6,9 @@ PaperTrail::Version.module_eval do
|
|||
end
|
||||
|
||||
# Store console and rake changes in versions
|
||||
if defined?(::Rails::Console)
|
||||
PaperTrail.whodunnit = "#{`whoami`.strip}: console"
|
||||
if defined?(::Rails::Console) || File.basename($PROGRAM_NAME).split(' ').first == 'spring'
|
||||
PaperTrail.whodunnit = "console-#{`whoami`.strip}"
|
||||
elsif File.basename($PROGRAM_NAME) == "rake"
|
||||
PaperTrail.whodunnit = "#{`whoami`.strip}: rake #{ARGV.join ' '}"
|
||||
# rake username does not work when spring enabled
|
||||
PaperTrail.whodunnit = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue