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
1 change: 1 addition & 0 deletions lib/jsonapi/basic_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def _replace_fields(field_data)

class << self
def inherited(subclass)
super
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 this is really just a best practice. I don't think there's a test needed

subclass.abstract(false)
subclass.immutable(false)
subclass.caching(_caching)
Expand Down
4 changes: 4 additions & 0 deletions test/unit/resource/resource_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ def test_derived_not_abstract
refute PersonResource._abstract
end

def test_inherited_calls_superclass
assert_equal(BaseResource.subclasses, [PersonResource, SpecialBaseResource])
end

def test_nil_model_class
# ToDo:Figure out why this test does not work on Rails 4.0
# :nocov:
Expand Down