Class: Affiliation

Inherits:
ApplicationRecord show all
Defined in:
app/models/affiliation.rb

Overview

Affiliate two objects: one as the parent and the other as the child (affiliate).

Examples:

Affiliate a challenge with a space (child)

affiliation = Challenge.first.add_affiliation_to(Space.first)
affiliation.save!

Affiliate a challenge with a space (parent)

affiliation = Space.first.add_affiliation(Challenge.first)
affiliation.save!