From 2d1de27fd56dad1f6b001e77f6c9f1052642be5e Mon Sep 17 00:00:00 2001 From: Jan De Poorter Date: Tue, 18 Nov 2008 11:54:33 +0100 Subject: Failing eager-loading test with ranges --- activerecord/test/cases/associations/eager_test.rb | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 5f43975..1069d31 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -628,6 +628,15 @@ class EagerAssociationTest < ActiveRecord::TestCase end end + def test_eager_with_ranges + david = developers(:david) + david.audit_logs.create! :message => "Include me plz!" + assert_queries(2) do + # Before changes, the dots in the Range#to_s would be interpreted as table names and will cause this to run in one query + Developer.find :all, :conditions => {:created_at => 10.year.ago..Time.now}, :include => :audit_logs + end + end + def test_preconfigured_includes_with_belongs_to author = posts(:welcome).author_with_posts assert_no_queries {assert_equal 5, author.posts.size} -- 1.5.6.rc0.29.g3beb5