Module: ContentfulModel::Associations::BelongsTo::ClassMethods

Defined in:
lib/contentful_model/associations/belongs_to.rb

Overview

Class method

Instance Method Summary collapse

Instance Method Details

#belongs_to(_association_name, _opts = {}) ⇒ Object

belongs_to is called on the child, and creates methods for mapping to the parent

Parameters:

  • _association_name (Symbol)

    the singular name of the parent



13
14
15
16
17
18
# File 'lib/contentful_model/associations/belongs_to.rb', line 13

def belongs_to(_association_name, _opts = {})
  fail(
    NotImplementedError,
    "Contentful doesn't have a singular belongs_to relationship. Use belongs_to_many instead."
  )
end