Skip to content
Browse files

only check uniqueness if the column changed

  • Loading branch information...
1 parent 123a721 commit 6806ab917c06bd00265fb253a13196cd350d8909 @netskin-ci netskin-ci committed
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/sequel_sexy_validations/validators/uniqueness.rb
2 lib/sequel_sexy_validations/validators/uniqueness.rb
@@ -7,6 +7,8 @@ class Uniqueness
def self.validate(model, attribute, value, options)
return unless value
+ return unless model.changed_columns.include?(attribute)
unless model.class.filter(~:id =>, attribute => value).empty?
model.errors.add(attribute, "bereits vergeben")

0 comments on commit 6806ab9

Please sign in to comment.
Something went wrong with that request. Please try again.