Skip to content

Commit ad12cba

Browse files
authored
Merge pull request #969 from scottgonzalez/base-resource-wording
Fix wording for missing model
2 parents 671d28f + 57fa0ae commit ad12cba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/jsonapi/resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ def _model_class
862862

863863
@model_class = model_name.to_s.safe_constantize
864864
if @model_class.nil?
865-
warn "[MODEL NOT FOUND] Model could not be found for #{self.name}. If this a base Resource declare it as abstract."
865+
warn "[MODEL NOT FOUND] Model could not be found for #{self.name}. If this is a base Resource declare it as abstract."
866866
end
867867

868868
@model_class

test/unit/resource/resource_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_nil_model_class
184184
# ToDo:Figure out why this test does not work on Rails 4.0
185185
# :nocov:
186186
if (Rails::VERSION::MAJOR >= 4 && Rails::VERSION::MINOR >= 1) || (Rails::VERSION::MAJOR >= 5)
187-
assert_output nil, "[MODEL NOT FOUND] Model could not be found for NoMatchResource. If this a base Resource declare it as abstract.\n" do
187+
assert_output nil, "[MODEL NOT FOUND] Model could not be found for NoMatchResource. If this is a base Resource declare it as abstract.\n" do
188188
assert_nil NoMatchResource._model_class
189189
end
190190
end
@@ -637,7 +637,7 @@ class NoModelResource < JSONAPI::Resource
637637
NoModelResource._model_class
638638
CODE
639639
end
640-
assert_match "[MODEL NOT FOUND] Model could not be found for ResourceTest::NoModelResource. If this a base Resource declare it as abstract.\n", err
640+
assert_match "[MODEL NOT FOUND] Model could not be found for ResourceTest::NoModelResource. If this is a base Resource declare it as abstract.\n", err
641641
end
642642

643643
def test_no_warning_when_abstract

0 commit comments

Comments
 (0)