aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-07-31 16:35:58 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-07-31 16:35:58 -0700
commit46a458206f1117b87e672bc5aae046eaa832ee00 (patch)
treeb2692b98da56d23394605594c9dea5610719e7e0 /activerecord/test/cases/associations
parenta540725f0d3439ea3b0f938d04ceed87d3690d9d (diff)
parent0b9bfbdebf402f4a149359a069dbeb05ea989b14 (diff)
downloadrails-46a458206f1117b87e672bc5aae046eaa832ee00.tar.gz
rails-46a458206f1117b87e672bc5aae046eaa832ee00.tar.bz2
rails-46a458206f1117b87e672bc5aae046eaa832ee00.zip
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/associations/belongs_to_associations_test.rb0
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb2
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb9
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/associations/has_one_associations_test.rb0
4 files changed, 7 insertions, 4 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb
index 9c718c4fef..9c718c4fef 100755..100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index f8b8b1f96d..47e4b3527d 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -1007,7 +1007,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
firm.clients.create({ :name => 'Some Client' })
stats = Namespaced::Firm.find(firm.id, {
- :select => "#{Namespaced::Firm.table_name}.*, COUNT(#{Namespaced::Client.table_name}.id) AS num_clients",
+ :select => "#{Namespaced::Firm.table_name}.id, COUNT(#{Namespaced::Client.table_name}.id) AS num_clients",
:joins => :clients,
:group => "#{Namespaced::Firm.table_name}.id"
})
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index be5170f830..d51a3c7e1c 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -2,15 +2,18 @@ require "cases/helper"
require 'models/post'
require 'models/person'
require 'models/reader'
+require 'models/comment'
class HasManyThroughAssociationsTest < ActiveRecord::TestCase
- fixtures :posts, :readers, :people
+ fixtures :posts, :readers, :people, :comments
def test_associate_existing
assert_queries(2) { posts(:thinking);people(:david) }
-
+
+ posts(:thinking).people
+
assert_queries(1) do
- posts(:thinking).people << people(:david)
+ posts(:thinking).people << people(:david)
end
assert_queries(1) do
diff --git a/activerecord/test/cases/associations/has_one_associations_test.rb b/activerecord/test/cases/associations/has_one_associations_test.rb
index 99639849a5..99639849a5 100755..100644
--- a/activerecord/test/cases/associations/has_one_associations_test.rb
+++ b/activerecord/test/cases/associations/has_one_associations_test.rb