File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
require 'global_id/global_id'
2
+ require 'active_support'
2
3
3
4
autoload :SignedGlobalID , 'global_id/signed_global_id'
4
5
5
6
class GlobalID
6
- autoload :Locator , 'global_id/locator'
7
- autoload :Identification , 'global_id/identification'
8
- autoload :Verifier , 'global_id/verifier'
7
+ extend ActiveSupport ::Autoload
8
+
9
+ eager_autoload do
10
+ autoload :Locator
11
+ autoload :Identification
12
+ autoload :Verifier
13
+ end
14
+
15
+ def self . eager_load!
16
+ super
17
+ require 'global_id/signed_global_id'
18
+ end
9
19
end
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class GlobalID
11
11
# Set up the signed GlobalID verifier and include Active Record support.
12
12
class Railtie < Rails ::Railtie # :nodoc:
13
13
config . global_id = ActiveSupport ::OrderedOptions . new
14
+ config . eager_load_namespaces << GlobalID
14
15
15
16
initializer 'global_id' do |app |
16
17
You can’t perform that action at this time.
0 commit comments