fixed the primary keys => all the classes have now composite primary key which contais an id + user_id, necessary gem: 'composite_primary_keys' fixed the user_id relation => every class now "belongs_to" user pls kill me know
6 lines
143 B
Ruby
6 lines
143 B
Ruby
class FavoritePerson < ApplicationRecord
|
|
self.primary_keys = :tiss_id, :user_id
|
|
|
|
validates :tiss_id, uniqueness: { scope: [:user_id] }
|
|
end
|