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

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

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

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/contentful_model/associations/belongs_to.rb', line 11

def belongs_to(association_name, opts = {})
  raise NotImplementedError, "Contentful doesn't have a singular belongs_to relationship. Use belongs_to_many instead."
end