1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

add a factory method for production LOWER functions

This commit is contained in:
Aaron Patterson 2011-04-25 12:01:22 -07:00
parent f72989de5b
commit 30c7f0e4b3
2 changed files with 13 additions and 0 deletions

View file

@ -25,5 +25,11 @@ module Arel
def grouping expr
Nodes::Grouping.new expr
end
###
# Create a LOWER() function
def lower column
Nodes::NamedFunction.new 'LOWER', [column]
end
end
end

View file

@ -22,6 +22,13 @@ module Arel
assert_instance_of Nodes::On, on
assert_equal :one, on.expr
end
def test_lower
lower = @factory.lower :one
assert_instance_of Nodes::NamedFunction, lower
assert_equal 'LOWER', lower.name
assert_equal [:one], lower.expressions
end
end
end
end