dkubb/veritas — Issue #6: Relation equality considers completely unequal relations as equal
Author: d11wtq
Created: 2011-11-03 14:11:23+00:00
State: open

Given two relations of different types, testing them for equality should always return false.

``` ruby
Veritas::TABLE_DEE == Veritas::Relation.new([ [:ID, Integer] ], [ [20] ])
# => true
```

This is a bug. The only relations that should ever be considered equal are those that have the same headers and the same set of tuples (order irrelevant).

The issue comes from the fact Veritas is coercing and projecting the other side of the comparison to match itself, before doing the comparison, which breaks the intention.

``` ruby
Veritas::Relation.new([ [:ID, Integer] ], [ [20] ]).header
# => []

Veritas::TABLE_DEE.send(:coerce, Veritas::Relation.new([ [:ID, Integer] ], [ [20] ])).header
# => []
```