diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-14 16:19:58 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-14 16:19:58 +0000 |
commit | 9ccb12a3dda123942def21834eedb761299f67b9 (patch) | |
tree | 3e16109a5d283b3959ef6c3bd27d29dffc12b9d1 /activerecord | |
parent | 0227f86eee4502588c1d56638f2dabcb886cde28 (diff) | |
download | rails-9ccb12a3dda123942def21834eedb761299f67b9.tar.gz rails-9ccb12a3dda123942def21834eedb761299f67b9.tar.bz2 rails-9ccb12a3dda123942def21834eedb761299f67b9.zip |
Test that calculations don't modify their options hash. References #6929. [eventualbuddha]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5931 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/calculations_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/calculations_test.rb b/activerecord/test/calculations_test.rb index 23c45f8637..e450c0a917 100644 --- a/activerecord/test/calculations_test.rb +++ b/activerecord/test/calculations_test.rb @@ -131,6 +131,14 @@ class CalculationsTest < Test::Unit::TestCase assert_equal 2, c[companies(:rails_core)] assert_equal 1, c[companies(:first_client)] end + + def test_should_not_modify_options_when_using_includes + options = {:conditions => 'companies.id > 1', :include => :firm} + options_copy = options.dup + + Account.count(:all, options) + assert_equal options_copy, options + end def test_should_calculate_grouped_by_function c = Company.count(:all, :group => "UPPER(#{QUOTED_TYPE})") |