aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/timezones.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/lib/active_job/timezones.rb')
-rw-r--r--activejob/lib/active_job/timezones.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activejob/lib/active_job/timezones.rb b/activejob/lib/active_job/timezones.rb
new file mode 100644
index 0000000000..ac018eb752
--- /dev/null
+++ b/activejob/lib/active_job/timezones.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module ActiveJob
+ module Timezones #:nodoc:
+ extend ActiveSupport::Concern
+
+ included do
+ around_perform do |job, block|
+ Time.use_zone(job.timezone, &block)
+ end
+ end
+ end
+end