use the right scope
parent
79563cc2a2
commit
44f525adbb
|
@ -1,5 +1,5 @@
|
|||
class PhotoFlag < ActiveRecord::Base
|
||||
belongs_to :photo, :counter_cache => true
|
||||
belongs_to :user
|
||||
validates_uniqueness_of :user_id
|
||||
validates_uniqueness_of :user_id, :scope => :photo_id
|
||||
end
|
||||
|
|
Reference in New Issue