diff --git a/app/models/tag_image.rb b/app/models/tag_image.rb index 18a39fe..9684082 100644 --- a/app/models/tag_image.rb +++ b/app/models/tag_image.rb @@ -2,7 +2,7 @@ class TagImage < ActiveRecord::Base belongs_to :image belongs_to :tagged, :polymorphic => true validates_presence_of :image_id, :tagged_id, :tagged_type - validates_uniqueness_of :tagged_id, :scope => :tagged_type + validates_uniqueness_of :tagged_id, :scope => [ :tagged_type, :image_id ] def self.types_for_select [ 'Beer', 'People', 'Brewery' ].collect { |x| [x] }