Refactor duplicated #log method

This commit is contained in:
Ryland Herrick and Vipul A M 2013-06-30 13:00:23 -05:00 committed by Ryland Herrick
parent f6b850e7a4
commit 2ffdc5fa27
3 changed files with 8 additions and 16 deletions

View File

@ -18,6 +18,14 @@ module Jobs
class Base
include Sidekiq::Worker
def log(*args)
puts args
args.each do |arg|
Rails.logger.info "#{Time.now.to_formatted_s(:db)}: [#{self.class.name.upcase}] #{arg}"
end
true
end
def self.delayed_perform(opts={})
self.new.perform(opts)
end

View File

@ -106,14 +106,6 @@ module Jobs
true
end
def log(*args)
puts args
args.each do |arg|
Rails.logger.info "#{Time.now.to_formatted_s(:db)}: [EXPORTER] #{arg}"
end
true
end
end
end

View File

@ -276,14 +276,6 @@ module Jobs
@warnings << message
end
def log(*args)
puts args
args.each do |arg|
Rails.logger.info "#{Time.now.to_formatted_s(:db)}: [IMPORTER] #{arg}"
end
true
end
end
end