Permalink
Browse files

fix bug when no scope was given

  • Loading branch information...
1 parent 1701e8a commit 30b8326e00114fbe8684523a03b66ffb1efb4539 @netskin-ci netskin-ci committed Nov 14, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/sequel_sexy_validations/validators/uniqueness.rb
View
4 lib/sequel_sexy_validations/validators/uniqueness.rb
@@ -31,7 +31,9 @@ def self.validate(model, attribute, value, options)
options[:message] ||= "bereits vergeben"
dataset = model.class.filter(~{:id => model.id}, {attribute => value})
- apply_scope_filter!(model, dataset, options[:scope])
+ if options[:scope]
+ apply_scope_filter!(model, dataset, options[:scope])
+ end
unless dataset.empty?
model.errors.add(attribute, options[:message])

0 comments on commit 30b8326

Please sign in to comment.