Skip to content

Commit

Permalink
noteq -> not_eq, notmatches -> not_matches, notin -> not_in
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernie Miller authored and brynary committed May 14, 2010
1 parent 50aaae7 commit 14d500c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/arel/algebra/attributes/attribute.rb
Expand Up @@ -84,15 +84,15 @@ def /(other)
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)
Expand Down
8 changes: 4 additions & 4 deletions spec/shared/relation_spec.rb
Expand Up @@ -35,9 +35,9 @@
@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
Expand Down Expand Up @@ -67,7 +67,7 @@

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
Expand All @@ -77,7 +77,7 @@

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
Expand Down

0 comments on commit 14d500c

Please sign in to comment.