Skip to content

Commit a5b06b6

Browse files
gnfisherlgebhardt
authored andcommitted
Catch LoadError when checkin for engine
(cherry picked from commit 31d22d1)
1 parent 4239561 commit a5b06b6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/jsonapi/link_builder.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ def self_link(source)
5757
def build_engine_name
5858
scopes = module_scopes_from_class(primary_resource_klass)
5959

60-
unless scopes.empty?
61-
"#{ scopes.first.to_s.camelize }::Engine".safe_constantize
60+
begin
61+
unless scopes.empty?
62+
"#{ scopes.first.to_s.camelize }::Engine".safe_constantize
63+
end
64+
rescue LoadError => e
65+
nil
6266
end
6367
end
6468

0 commit comments

Comments
 (0)