aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-08-29 15:01:17 +0100
committerJon Leighton <j@jonathanleighton.com>2011-08-29 15:05:47 +0100
commit735d985b0162976e7e900cf36d4cbb0d657fb5e9 (patch)
tree6d28ea963504b2f458b81eb6c32ac471b937f316 /activerecord/test/models
parentfd22d040fef48778a519825dd2f0cf2fd73a8965 (diff)
downloadrails-735d985b0162976e7e900cf36d4cbb0d657fb5e9.tar.gz
rails-735d985b0162976e7e900cf36d4cbb0d657fb5e9.tar.bz2
rails-735d985b0162976e7e900cf36d4cbb0d657fb5e9.zip
The join_nodes must be passed to the JoinDependency initializer and therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/toy.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/models/toy.rb b/activerecord/test/models/toy.rb
index 79a88db0da..6c45e99671 100644
--- a/activerecord/test/models/toy.rb
+++ b/activerecord/test/models/toy.rb
@@ -1,4 +1,6 @@
class Toy < ActiveRecord::Base
set_primary_key :toy_id
belongs_to :pet
+
+ scope :with_pet, joins(:pet)
end