aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-07-26 15:12:36 -0400
committerJosé Valim <jose.valim@gmail.com>2010-08-02 17:12:59 +0200
commit009aa8825b6932b006f005ac351b82ad8100d7f1 (patch)
tree5e5a86d710a45399347adbc38a22db1b4a2a3fad /activerecord/test/models
parent59693c4c49cce5e4cf53eb54e42e3da07a98467e (diff)
downloadrails-009aa8825b6932b006f005ac351b82ad8100d7f1.tar.gz
rails-009aa8825b6932b006f005ac351b82ad8100d7f1.tar.bz2
rails-009aa8825b6932b006f005ac351b82ad8100d7f1.zip
Eager loading an association should not change the count of children
[#4971 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/electron.rb3
-rw-r--r--activerecord/test/models/liquid.rb5
-rw-r--r--activerecord/test/models/molecule.rb4
3 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/models/electron.rb b/activerecord/test/models/electron.rb
new file mode 100644
index 0000000000..35af9f679b
--- /dev/null
+++ b/activerecord/test/models/electron.rb
@@ -0,0 +1,3 @@
+class Electron < ActiveRecord::Base
+ belongs_to :molecule
+end
diff --git a/activerecord/test/models/liquid.rb b/activerecord/test/models/liquid.rb
new file mode 100644
index 0000000000..b96c054f6c
--- /dev/null
+++ b/activerecord/test/models/liquid.rb
@@ -0,0 +1,5 @@
+class Liquid < ActiveRecord::Base
+ set_table_name :liquid
+ has_many :molecules, :uniq => true
+end
+
diff --git a/activerecord/test/models/molecule.rb b/activerecord/test/models/molecule.rb
new file mode 100644
index 0000000000..69325b8d29
--- /dev/null
+++ b/activerecord/test/models/molecule.rb
@@ -0,0 +1,4 @@
+class Molecule < ActiveRecord::Base
+ belongs_to :liquid
+ has_many :electrons
+end