diff --git a/lib/jsonapi/resource.rb b/lib/jsonapi/resource.rb index 0314142bc..f10860caf 100644 --- a/lib/jsonapi/resource.rb +++ b/lib/jsonapi/resource.rb @@ -279,7 +279,6 @@ def inherited(subclass) subclass.abstract(false) subclass.immutable(false) subclass._attributes = (_attributes || {}).dup - subclass.model_name(_model_name, add_model_hint: false) unless _model_name == '' subclass._model_hints = (_model_hints || {}).dup subclass._relationships = {} diff --git a/test/unit/resource/resource_test.rb b/test/unit/resource/resource_test.rb index 0393b5181..74ccdc168 100644 --- a/test/unit/resource/resource_test.rb +++ b/test/unit/resource/resource_test.rb @@ -86,7 +86,11 @@ def setup end def test_model_name - assert_equal(PostResource._model_name, 'Post') + assert_equal("Post", PostResource._model_name) + end + + def test_model_name_of_subclassed_non_abstract_resource + assert_equal("Firm", FirmResource._model_name) end def test_model