HABTM duplicate records

后端 未结 4 679
醉梦人生
醉梦人生 2020-12-30 13:18

I have a 2 models Game & Theme and they have a has_and_belongs_to_many association. I have tried many solutions to prevent duplicate records in

4条回答
  •  梦毁少年i
    2020-12-30 14:10

    To run validations on join table you should use has_many :through association instead. http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association

提交回复
热议问题