fix reverse n-to-n relationship

This commit is contained in:
2021-04-25 00:29:56 +02:00
parent 9082e5255e
commit 3f1e9cedb1
2 changed files with 4 additions and 2 deletions

View File

@@ -2,8 +2,8 @@ class WowMount < ApplicationRecord
extend Mobility
translates :name, :description, :translated_faction, :translated_source
has_many :user_obtain_mounts, dependent: :destroy
has_many :users, through: :user_obtain_mounts
has_many :user_obtain_wow_mounts, dependent: :destroy
has_many :users, through: :user_obtain_wow_mounts
validates :name, presence: true
validates :mount_id, presence: true, uniqueness: true