acts-as-taggable-on gem has a built-in uniqueness validation:
validates_uniqueness_of :name, if: :validates_name_uniqueness?
def validates_name_uniqueness?
true
end
How do I add a scope to this validation?
I want to add scope: :user_id
and don't know how to edit a gem source code.
I was able to fix my problem with the help of acts_as_taggable_on.rb file in config/initializers: