We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e95947 commit 35ceb7fCopy full SHA for 35ceb7f
1 file changed
lib/jsonapi/resource.rb
@@ -431,7 +431,11 @@ def has_one(*attrs)
431
end
432
433
def belongs_to(*attrs)
434
- # TODO: Add cool deprecation message here
+ ActiveSupport::Deprecation.warn "In #{name} you exposed a `has_one` relationship "\
435
+ " using the `belongs_to` class method. We think `has_one`" \
436
+ " is more appropriate. If you know what you're doing," \
437
+ " and don't want to see this warning again, override the" \
438
+ " `belongs_to` class method on your resource."
439
_add_relationship(Relationship::ToOne, *attrs)
440
441
0 commit comments