提交 59300208 编写于 作者: A Aaron Patterson

Merge pull request #55 from samuelkadolph/add_predicates_to_function_node

Include Arel::Predicates to Arel::Nodes::Function
......@@ -2,6 +2,7 @@ module Arel
module Nodes
class Function < Arel::Nodes::Node
include Arel::Expression
include Arel::Predications
attr_accessor :expressions, :alias, :distinct
def initialize expr, aliaz = nil
......
......@@ -3,8 +3,6 @@ module Nodes
class NamedFunction < Arel::Nodes::Function
attr_accessor :name
include Arel::Predications
def initialize name, expr, aliaz = nil
super(expr, aliaz)
@name = name
......
......@@ -15,4 +15,13 @@
}
end
end
describe "eq" do
it "should compare the count" do
table = Arel::Table.new :users
table[:id].count.eq(2).to_sql.must_be_like %{
COUNT("users"."id") = 2
}
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册