mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Merge branch 'master' into remove-spring-gem
# Conflicts: # config/environments/test.rb
This commit is contained in:
commit
78d7d5d894
39 changed files with 107 additions and 188 deletions
23
lib/gem_ext/paper_trail.rb
Normal file
23
lib/gem_ext/paper_trail.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
# the following line is required for PaperTrail >= 4.0.0 with Rails
|
||||
PaperTrail::Rails::Engine.eager_load!
|
||||
|
||||
PaperTrail::Version.module_eval do
|
||||
self.abstract_class = true
|
||||
end
|
||||
|
||||
# Store console and rake changes in versions
|
||||
if defined?(::Rails::Console)
|
||||
PaperTrail.whodunnit = "console-#{`whoami`.strip}"
|
||||
elsif File.basename($PROGRAM_NAME) == 'rake'
|
||||
# rake username does not work when spring enabled
|
||||
PaperTrail.whodunnit = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
|
||||
end
|
||||
|
||||
class PaperSession
|
||||
class << self
|
||||
attr_writer :session
|
||||
def session
|
||||
@session ||= Time.zone.now.to_s(:db)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue