aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2010-05-05 14:05:56 -0400
committerErnie Miller <ernie@metautonomo.us>2010-05-07 13:08:59 -0400
commit0f68c734b1642c4960778f8924d2c752717e2790 (patch)
treee9c74c639180c148f9b96fa4076a55b228ec148c
parent5afed6d45def1e72df24679a746cbe96b52c1709 (diff)
downloadrails-0f68c734b1642c4960778f8924d2c752717e2790.tar.gz
rails-0f68c734b1642c4960778f8924d2c752717e2790.tar.bz2
rails-0f68c734b1642c4960778f8924d2c752717e2790.zip
noteq -> not_eq, notmatches -> not_matches, notin -> not_in
-rw-r--r--lib/arel/algebra/attributes/attribute.rb6
-rw-r--r--spec/shared/relation_spec.rb8
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/arel/algebra/attributes/attribute.rb b/lib/arel/algebra/attributes/attribute.rb
index 640d6facde..64ea93d227 100644
--- a/lib/arel/algebra/attributes/attribute.rb
+++ b/lib/arel/algebra/attributes/attribute.rb
@@ -84,15 +84,15 @@ module Arel
module Predications
methods = {
:eq => "Equality",
- :noteq => "Inequality",
+ :not_eq => "Inequality",
:lt => "LessThan",
:lteq => "LessThanOrEqualTo",
:gt => "GreaterThan",
:gteq => "GreaterThanOrEqualTo",
:matches => "Match",
- :notmatches => "NotMatch",
+ :not_matches => "NotMatch",
:in => "In",
- :notin => "NotIn"
+ :not_in => "NotIn"
}
def self.predication(name, klass)
diff --git a/spec/shared/relation_spec.rb b/spec/shared/relation_spec.rb
index dabbde2dd5..0759700d8a 100644
--- a/spec/shared/relation_spec.rb
+++ b/spec/shared/relation_spec.rb
@@ -35,9 +35,9 @@ share_examples_for 'A Relation' do
@relation.where(@relation[:age].eq(@pivot[@relation[:age]])).should have_rows(expected)
end
- it "finds rows with a noteq predicate" do
+ it "finds rows with a not eq predicate" do
expected = @expected.select { |r| r[@relation[:age]] != @pivot[@relation[:age]] }
- @relation.where(@relation[:age].noteq(@pivot[@relation[:age]])).should have_rows(expected)
+ @relation.where(@relation[:age].not_eq(@pivot[@relation[:age]])).should have_rows(expected)
end
it "finds rows with a less than predicate" do
@@ -67,7 +67,7 @@ share_examples_for 'A Relation' do
it "finds rows with a not matches predicate" do
expected = @expected.select { |r| r[@relation[:name]] !~ /#{@pivot[@relation[:name]]}/ }
- @relation.where(@relation[:name].notmatches(/#{@pivot[@relation[:name]]}/)).should have_rows(expected)
+ @relation.where(@relation[:name].not_matches(/#{@pivot[@relation[:name]]}/)).should have_rows(expected)
end
it "finds rows with an in predicate" do
@@ -77,7 +77,7 @@ share_examples_for 'A Relation' do
it "finds rows with a not in predicate" do
expected = @expected.select {|r| !(r[@relation[:age]] >=3 && r[@relation[:age]] <= 20)}
- @relation.where(@relation[:age].notin(3..20)).should have_rows(expected)
+ @relation.where(@relation[:age].not_in(3..20)).should have_rows(expected)
end
it "finds rows with a not predicate" do