I hereby claim:
- I am bramj on github.
- I am bramj (https://keybase.io/bramj) on keybase.
- I have a public key whose fingerprint is B5E1 8FCD 8432 F547 D9B7 8433 7CB3 379E E0F8 7B75
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# The problem: I needed to create bundles, to be able to sell collections of both courses as well as tracks. (and in the future possibly more things) | |
# But in return, a track/course can also belong to multiple bundles. | |
# So: bundle has_many tracks/courses, tracks/courses has_many bundles | |
# (This was work in progress, but if I remember correctly, it works.) | |
# app/models/bundle.rb | |
class Bundle < ActiveRecord::Base | |
# Creating a polymorphic HABTM relation in Rails is not possible, | |
# this does basically the same thing | |
has_many :bundles_bundleables # terrible naming |