diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2019-01-24 16:00:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-24 16:00:46 -0500 |
commit | 267136d87d0d032f7a95c62f115940393e1620e5 (patch) | |
tree | 8174d3d9c7b24a38a4410a380a89ac62c7a28351 /activerecord/test/cases/arel/nodes/and_test.rb | |
parent | 1e25dfde032172bab2b126e60fac0302025defcc (diff) | |
parent | 5cf36e2ea2242ea6ea0cf879adf9febd86fd3aa2 (diff) | |
download | rails-267136d87d0d032f7a95c62f115940393e1620e5.tar.gz rails-267136d87d0d032f7a95c62f115940393e1620e5.tar.bz2 rails-267136d87d0d032f7a95c62f115940393e1620e5.zip |
Merge pull request #35046 from kddeisz/make-and-and-case-node-expressions
Make `And` and `Case` into expression nodes
Diffstat (limited to 'activerecord/test/cases/arel/nodes/and_test.rb')
-rw-r--r-- | activerecord/test/cases/arel/nodes/and_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/arel/nodes/and_test.rb b/activerecord/test/cases/arel/nodes/and_test.rb index eff54abd91..d123ca9fd0 100644 --- a/activerecord/test/cases/arel/nodes/and_test.rb +++ b/activerecord/test/cases/arel/nodes/and_test.rb @@ -16,6 +16,15 @@ module Arel assert_equal 2, array.uniq.size end end + + describe "functions as node expression" do + it "allows aliasing" do + aliased = And.new(["foo", "bar"]).as("baz") + + assert_kind_of As, aliased + assert_kind_of SqlLiteral, aliased.right + end + end end end end |