Rails find_or_create_by more than one attribute?

There is a handy dynamic attribute in active-record called find_or_create_by: Model.find_or_create_by_<attribute>(:<attribute> => “”) But what if I need to find_or_create by more than one attribute? Say I have a model to handle a M:M relationship between Group and Member called GroupMember. I could have many instances where member_id = 4, but I don’t ever want … Read more