In the tagging example, we can find posts having a certain tag with this:
Post.find(tag: 'tagging')
Now how would someone be able to get the posts matching a tag (pretty much reversed logic) ?
I'm assuming you would need a reference in the Tag model to the Post model but I can't quite figure it in the Ohm way:
class Tag < Ohm::Model
counter :total
reference :posts, :Post
# How would you query Tag model after that to find the posts associated ?
Any chance it could be added to the example ?
Thanks a lot!
In the tagging example, we can find posts having a certain tag with this:
Now how would someone be able to get the posts matching a tag (pretty much reversed logic) ?
I'm assuming you would need a reference in the
Tagmodel to the Post model but I can't quite figure it in the Ohm way:Any chance it could be added to the example ?
Thanks a lot!