aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorPeter Wagenet <peter.wagenet@gmail.com>2008-07-02 21:27:42 -0400
committerPratik Naik <pratiknaik@gmail.com>2008-08-21 17:21:17 +0100
commit8622787f8748434b4ceb2b925a35b17a38e1f2d6 (patch)
tree421b5424d77319f99a015b9658f447196d73a8c2 /activerecord/test
parent3724dafe71f4afb2ca9f4d7d2526b228aa6c05a3 (diff)
downloadrails-8622787f8748434b4ceb2b925a35b17a38e1f2d6.tar.gz
rails-8622787f8748434b4ceb2b925a35b17a38e1f2d6.tar.bz2
rails-8622787f8748434b4ceb2b925a35b17a38e1f2d6.zip
Don't interpret decimals as table names in ActiveRecord::Associations::ClassMethods#references_eager_loaded_tables? [#532 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/eager_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb
index 58506574f8..f37e18df35 100644
--- a/activerecord/test/cases/associations/eager_test.rb
+++ b/activerecord/test/cases/associations/eager_test.rb
@@ -559,6 +559,13 @@ class EagerAssociationTest < ActiveRecord::TestCase
assert_nothing_raised { Post.find(:all, :include => 'comments') }
end
+ def test_eager_with_floating_point_numbers
+ assert_queries(2) do
+ # Before changes, the floating point numbers will be interpreted as table names and will cause this to run in one query
+ Comment.find :all, :conditions => "123.456 = 123.456", :include => :post
+ end
+ end
+
def test_preconfigured_includes_with_belongs_to
author = posts(:welcome).author_with_posts
assert_no_queries {assert_equal 5, author.posts.size}