mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Fix have_db_index_matcher bug on JRuby
So matched_index.unique actually returns an integer instead of true and returns nil instead of false in JRuby. This `!!` operator should fix it.
This commit is contained in:
parent
6785f596b4
commit
1a3aeec47c
1 changed files with 2 additions and 2 deletions
|
@ -58,11 +58,11 @@ module Shoulda # :nodoc:
|
|||
|
||||
def correct_unique?
|
||||
return true if @unique.nil?
|
||||
if matched_index.unique == @unique
|
||||
if !!matched_index.unique == @unique
|
||||
true
|
||||
else
|
||||
@missing = "#{table_name} has an index named #{matched_index.name} " <<
|
||||
"of unique #{matched_index.unique}, not #{@unique}."
|
||||
"of unique #{!!matched_index.unique}, not #{@unique}."
|
||||
false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue