diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-29 14:40:21 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-29 14:40:21 -0200 |
commit | 6296c09e5b915c522c4127844c623afb44c62e1a (patch) | |
tree | 432fd1ab314451bc2f22e98f91a21772a7b33194 /activerecord/test/cases | |
parent | bb6fe7e73a96ac6a9130ed2a68a606ed5f5fb881 (diff) | |
parent | e94330fe40b472aec25a7b74b1294cbdc449b730 (diff) | |
download | rails-6296c09e5b915c522c4127844c623afb44c62e1a.tar.gz rails-6296c09e5b915c522c4127844c623afb44c62e1a.tar.bz2 rails-6296c09e5b915c522c4127844c623afb44c62e1a.zip |
Merge pull request #18722 from bogdan/group-by-key-word
Fixed AR::Relation#group method when argument is a SQL reserved keyword
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 8eb65d39ca..5c5ab499a0 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -16,6 +16,7 @@ require 'models/engine' require 'models/tyre' require 'models/minivan' require 'models/aircraft' +require "models/possession" class RelationTest < ActiveRecord::TestCase @@ -1482,6 +1483,10 @@ class RelationTest < ActiveRecord::TestCase assert_equal [post], having_then_where end + def test_grouping_by_column_with_reserved_name + assert_equal [], Possession.select(:where).group(:where).to_a + end + def test_references_triggers_eager_loading scope = Post.includes(:comments) assert !scope.eager_loading? |