I am trying to implement a simple tag system using a virtual tag attribute for a notes object. The tag contains the label and user_id. what I would like to do is update the HABTM to the relationship with the note based on what is in the tag field. I know about the methods find_or_create_by_X, is there something similar that I can do with two fields, that is, if the label and user_id are unique, create a new tag, otherwise you will get a tag where the labels and user ID match. Also there is a similar way to handle tag removal?
source
share