Browse files

fixed reference matcher

  • Loading branch information...
1 parent 1358f44 commit 3c68fe1ba555d6c39553d5efb1539ac36de4fd56 @mlomnicki committed Jan 10, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 spec/support/matchers/reference.rb
View
4 spec/support/matchers/reference.rb
@@ -14,7 +14,7 @@ def matches?(model)
if @references_table_name
@result = @model.foreign_keys.select do |fk|
fk.references_table_name == @references_table_name &&
- fk.references_column_names == @references_column_names
+ @references_column_names.empty? ? true : fk.references_column_names == @references_column_names
end
else
@result = @model.foreign_keys
@@ -26,7 +26,7 @@ def matches?(model)
(@on_delete ? fk.on_delete == @on_delete : true)
end
else
- !!@result
+ !@result.empty?
end
end

0 comments on commit 3c68fe1

Please sign in to comment.