aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/arel/algebra/predicates.rb1
-rw-r--r--spec/algebra/unit/predicates/inequality_spec.rb6
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/arel/algebra/predicates.rb b/lib/arel/algebra/predicates.rb
index 9764c4cfa2..e9fb51d889 100644
--- a/lib/arel/algebra/predicates.rb
+++ b/lib/arel/algebra/predicates.rb
@@ -197,6 +197,7 @@ module Arel
Equality.new(operand1, operand2)
end
+ def operator; :"!=" end
def eval(row)
operand1.eval(row) != operand2.eval(row)
end
diff --git a/spec/algebra/unit/predicates/inequality_spec.rb b/spec/algebra/unit/predicates/inequality_spec.rb
index 557494e2cd..f95b8d120e 100644
--- a/spec/algebra/unit/predicates/inequality_spec.rb
+++ b/spec/algebra/unit/predicates/inequality_spec.rb
@@ -12,6 +12,12 @@ module Arel
@b = Inequality.new(right, left)
end
+ describe 'operator' do
+ it "should have one" do
+ @a.operator.should == :"!="
+ end
+ end
+
describe '==' do
it "is equal to itself" do
@a.should == @a