diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-23 07:44:44 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-23 07:44:44 -0700 |
commit | 5af29cbde8c10f081bd8216338d0cdb661e23fb3 (patch) | |
tree | 7361d1a049c7f3921d29e866e39a347ecb798187 /activerecord/test | |
parent | 1bd92ed6b00e7938cfe9a8e01275170c49e9893d (diff) | |
parent | 746a9992f0a842ded7a15cc5ce0afd0fa00f2ada (diff) | |
download | rails-5af29cbde8c10f081bd8216338d0cdb661e23fb3.tar.gz rails-5af29cbde8c10f081bd8216338d0cdb661e23fb3.tar.bz2 rails-5af29cbde8c10f081bd8216338d0cdb661e23fb3.zip |
Merge pull request #10317 from arabonradar/ar_having_values_bug_fix
ActiveRecord having clause bug fix
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 9008c2785e..cf6af4e8f4 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -1299,6 +1299,14 @@ class RelationTest < ActiveRecord::TestCase assert_equal ['Foo', 'Foo'], query.uniq(true).uniq(false).map(&:name) end + def test_doesnt_add_having_values_if_options_are_blank + scope = Post.having('') + assert_equal [], scope.having_values + + scope = Post.having([]) + assert_equal [], scope.having_values + end + def test_references_triggers_eager_loading scope = Post.includes(:comments) assert !scope.eager_loading? |