I've just inherited a blog platform that uses Rails 3.2 (!!), and I'm looking to add some functionality. I have two models, Article
and Issue
, which I'd like to associate such that any Issue
has_many :articles
and and any Article
belongs_to :issue
.
I've looked into using the gem foreigner
to help with this, but I'm wondering if there's a way to do this without adding more gems. I've looked around SO and seen some conflicting stuff. This SO post seems to only apply to Rails 4, which I guess automatically generates this sort of migration.
Can I do this manually by migrating to create appropriate integer fields in both schemas, and then putting the has_many
and belong_to
statements in the models?
Thanks so much!
Aucun commentaire:
Enregistrer un commentaire