Method: JSONAPI::Resource.belongs_to

Defined in:
lib/jsonapi/resource.rb

.belongs_to(*attrs) ⇒ Object



523
524
525
526
527
528
529
530
# File 'lib/jsonapi/resource.rb', line 523

def belongs_to(*attrs)
  ActiveSupport::Deprecation.warn "In #{name} you exposed a `has_one` relationship "\
                                  " using the `belongs_to` class method. We think `has_one`" \
                                  " is more appropriate. If you know what you're doing," \
                                  " and don't want to see this warning again, override the" \
                                  " `belongs_to` class method on your resource."
  _add_relationship(Relationship::ToOne, *attrs)
end