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:
parent
f72989de5b
commit
30c7f0e4b3
2 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue