Skip to content

Commit 712bfc4

Browse files
authored
Set build timestamp initializer order (#126)
I noticed that some recent changes to my load order in a consuming app resulted in this initializer running too soon, before `Time.zone` was defined by Rails. This change forces it to always run _after_ `'active_support.initialize_time_zone'`.
1 parent f425552 commit 712bfc4

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

Gemfile.lock

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
test_track_rails_client (7.1.0)
4+
test_track_rails_client (7.1.1)
55
activejob (>= 6.0)
66
activemodel (>= 6.0)
77
faraday (>= 0.8)
@@ -239,6 +239,7 @@ GEM
239239
zeitwerk (2.6.12)
240240

241241
PLATFORMS
242+
arm64-darwin-22
242243
arm64-darwin-23
243244
x86_64-darwin-21
244245
x86_64-darwin-22

config/initializers/set_build_timestamp.rb

-1
This file was deleted.

gemfiles/rails_6_1.gemfile.lock

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
test_track_rails_client (7.1.0)
4+
test_track_rails_client (7.1.1)
55
activejob (>= 6.0)
66
activemodel (>= 6.0)
77
faraday (>= 0.8)
@@ -207,6 +207,7 @@ GEM
207207
zeitwerk (2.6.12)
208208

209209
PLATFORMS
210+
arm64-darwin-22
210211
arm64-darwin-23
211212
x86_64-darwin-21
212213
x86_64-darwin-22

gemfiles/rails_7_0.gemfile.lock

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
test_track_rails_client (7.1.0)
4+
test_track_rails_client (7.1.1)
55
activejob (>= 6.0)
66
activemodel (>= 6.0)
77
faraday (>= 0.8)
@@ -207,6 +207,7 @@ GEM
207207
zeitwerk (2.6.12)
208208

209209
PLATFORMS
210+
arm64-darwin-22
210211
arm64-darwin-23
211212
x86_64-darwin-21
212213
x86_64-darwin-22

lib/test_track_rails_client/engine.rb

+4
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ class Engine < ::Rails::Engine
99
config.generators do |g|
1010
g.test_framework :rspec
1111
end
12+
13+
initializer after: 'active_support.initialize_time_zone' do
14+
TestTrack.set_build_timestamp! unless ENV['SKIP_TESTTRACK_SET_BUILD_TIMESTAMP'] == '1'
15+
end
1216
end
1317
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module TestTrackRailsClient
2-
VERSION = "7.1.0".freeze
2+
VERSION = "7.1.1".freeze
33
end

0 commit comments

Comments
 (0)