Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Index: spec/symbolic_operators_spec.rb
===================================================================
--- spec/symbolic_operators_spec.rb (revision 738)
+++ spec/symbolic_operators_spec.rb (working copy)
@@ -24,4 +24,10 @@
   it 'age should not be nil' do
     Person.all(:age.not => nil).size.should == 5
   end
+  
+  it "should be equivalent" do
+    :age.not.should == :age.not
+    
+    {:age.not => 12}.has_key?(:age.not).should == true
+  end
 end
\ No newline at end of file
Index: lib/data_mapper/support/symbol.rb
===================================================================
--- lib/data_mapper/support/symbol.rb   (revision 738)
+++ lib/data_mapper/support/symbol.rb   (working copy)
@@ -15,6 +15,10 @@
         def to_sym
           @value
         end
+        
+        def ==(other)
+          (@value == other.value) && (@type == other.type) && (@options == other.options)
+        end
       end
     
       def gt