Permalink
Browse files

Merge branch 'master' of https://github.com/lightyear/shoulda-matchers

  • Loading branch information...
2 parents 3ee5e5f + 29a1fc6 commit 21fa1f1867fd708d8c72adc093702eae81de56e6 @mike-burns mike-burns committed Oct 14, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb
View
6 lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb
@@ -116,7 +116,11 @@ def validate_after_scope_change
# Assume the scope is a foreign key if the field is nil
previous_value ||= 0
- next_value = previous_value.next
+ next_value = if previous_value.respond_to?(:next)
+ previous_value.next
+ else
+ previous_value.to_s.next
+ end
@subject.send("#{scope}=", next_value)

0 comments on commit 21fa1f1

Please sign in to comment.