We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d8df4c commit 037ce20Copy full SHA for 037ce20
app/models/post_user.rb
@@ -4,4 +4,5 @@ class PostUser < ActiveRecord::Base
4
belongs_to :user
5
6
validates :user_id, :post_id, presence: true
7
+ validates :user_id, uniqueness: { scope: :post_id }
8
end
0 commit comments