diff options
author | Bogdan Gusiev <agresso@gmail.com> | 2015-01-29 17:02:12 +0200 |
---|---|---|
committer | Bogdan Gusiev <agresso@gmail.com> | 2015-01-29 17:27:02 +0200 |
commit | e94330fe40b472aec25a7b74b1294cbdc449b730 (patch) | |
tree | 29319d1cbce31fde6761890f6d2a53d51c4e1387 /activerecord/test | |
parent | 069b72aaf04d2caef76f8e71f320716129f2d949 (diff) | |
download | rails-e94330fe40b472aec25a7b74b1294cbdc449b730.tar.gz rails-e94330fe40b472aec25a7b74b1294cbdc449b730.tar.bz2 rails-e94330fe40b472aec25a7b74b1294cbdc449b730.zip |
Fixed AR::Relation#group method when argument is a SQL reserved keyword
Diffstat (limited to 'activerecord/test')
-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? |