Skip to content

Commit 357278f

Browse files
authored
Merge pull request #926 from gnfisher/450-engine-clash
Catch LoadError when checkin for engine
2 parents f5f8444 + 31d22d1 commit 357278f

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)