Skip to content

Commit 6e95947

Browse files
authored
Change alias into a method
Prepare
1 parent b274613 commit 6e95947

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/jsonapi/resource.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,11 @@ def relationship(*attrs)
429429
def has_one(*attrs)
430430
_add_relationship(Relationship::ToOne, *attrs)
431431
end
432-
alias_method :belongs_to, :has_one
432+
433+
def belongs_to(*attrs)
434+
# TODO: Add cool deprecation message here
435+
_add_relationship(Relationship::ToOne, *attrs)
436+
end
433437

434438
def has_many(*attrs)
435439
_add_relationship(Relationship::ToMany, *attrs)

0 commit comments

Comments
 (0)