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
146 B
Ruby
6 lines
146 B
Ruby
class FavoriteThesis < ApplicationRecord
|
|
self.primary_keys = :id, :user_id
|
|
|
|
validates :id, :user_id, uniqueness: {scope: [:id, :user_id]}
|
|
end
|