Skip to content

Commit 28d062f

Browse files
authored
Merge pull request #822 from valscion/fix-readme-relationship-method-example
Fix code example for relationship specific method definitions
2 parents 33dc8dd + dd08a32 commit 28d062f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,11 +735,13 @@ class PostResource < JSONAPI::Resource
735735
has_many :comments
736736

737737
# def record_for_author
738+
# relationship = self.class._relationship(:author)
738739
# relation_name = relationship.relation_name(context: @context)
739740
# records_for(relation_name)
740741
# end
741742

742743
# def records_for_comments
744+
# relationship = self.class._relationship(:comments)
743745
# relation_name = relationship.relation_name(context: @context)
744746
# records_for(relation_name)
745747
# end

0 commit comments

Comments
 (0)