Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jsonapi/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def paginator(paginator)
def _model_class
return @model if @model
@model = _model_name.to_s.safe_constantize
fail "model could not be found for #{self.name}" if @model.nil?
fail NameError, "model could not be found for #{self.name}" if @model.nil?
@model
end

Expand Down
2 changes: 1 addition & 1 deletion test/unit/resource/resource_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_model
end

def test_nil_model_class
error = assert_raises(StandardError) { NoMatchResource._model_class }
error = assert_raises(NameError) { NoMatchResource._model_class }
assert_equal(
error.message,
"model could not be found for NoMatchResource"
Expand Down