Method: JSONAPI::Resource._add_relationship
- Defined in:
- lib/jsonapi/resource.rb
._add_relationship(klass, *attrs) ⇒ Object
966 967 968 969 970 971 972 973 974 975 976 977 |
# File 'lib/jsonapi/resource.rb', line 966 def _add_relationship(klass, *attrs) = attrs. [:parent_resource] = self attrs.each do |relationship_name| check_reserved_relationship_name(relationship_name) check_duplicate_relationship_name(relationship_name) JSONAPI::RelationshipBuilder.new(klass, _model_class, ) .define_relationship_methods(relationship_name.to_sym) end end |