I have not see a way to directly access the through record when
creating a new has_many :through association. It would seem like I
have overlooked something, but in the meantime I created a patch to
allow for it.
I have not see a way to directly access the through record when
creating a new has_many :through association. It would seem like I
have overlooked something, but in the meantime I created a patch to
allow for it.
The :through part of those associations is really just an optimisation
to avoid having to write:
@tag.taggings.map(&:post)
If you need access to the tagging instances, just use @tag.taggings
instead of @tag.posts
The :through part of those associations is really just an optimisation
to avoid having to write:
@tag.taggings.map(&:post)
If you need access to the tagging instances, just use @tag.taggings
instead of @tag.posts
True, but I don't see how this helps in referencing the newly created
association.
where is the Tagging record in the below?
post = Post.find(:first).tags << Tag.find(:first)
I would like a reliable and easy method of referencing the created
association, which the patch provides and does so without presenting
any compatibility issues. However there might be another way, which I
have not thought of.