aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/eager_load_nested_include_test.rb
diff options
context:
space:
mode:
authorRizwan Reza <rizwanreza@gmail.com>2010-06-05 04:04:49 +0430
committerRizwan Reza <rizwanreza@gmail.com>2010-06-05 04:04:49 +0430
commite6f2102178b19ac8d49363b5fa145f22483c30ee (patch)
treeb5dff24210eb3f521087fe66a9b734165ad22967 /activerecord/test/cases/associations/eager_load_nested_include_test.rb
parent1535b02a9f8e0eaa3cd3182a45d2bd7855c3809c (diff)
parent8e8cb1769f3a78c53e5b79d0ce6a08589045cfca (diff)
downloadrails-e6f2102178b19ac8d49363b5fa145f22483c30ee.tar.gz
rails-e6f2102178b19ac8d49363b5fa145f22483c30ee.tar.bz2
rails-e6f2102178b19ac8d49363b5fa145f22483c30ee.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activerecord/test/cases/associations/eager_load_nested_include_test.rb')
-rw-r--r--activerecord/test/cases/associations/eager_load_nested_include_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/test/cases/associations/eager_load_nested_include_test.rb b/activerecord/test/cases/associations/eager_load_nested_include_test.rb
index 2beb3f8365..c7671a8c22 100644
--- a/activerecord/test/cases/associations/eager_load_nested_include_test.rb
+++ b/activerecord/test/cases/associations/eager_load_nested_include_test.rb
@@ -17,7 +17,7 @@ module Remembered
module ClassMethods
def remembered; @@remembered ||= []; end
- def random_element; @@remembered.random_element; end
+ def sample; @@remembered.sample; end
end
end
@@ -79,14 +79,14 @@ class EagerLoadPolyAssocsTest < ActiveRecord::TestCase
[Circle, Square, Triangle, NonPolyOne, NonPolyTwo].map(&:create!)
end
1.upto(NUM_SIMPLE_OBJS) do
- PaintColor.create!(:non_poly_one_id => NonPolyOne.random_element.id)
- PaintTexture.create!(:non_poly_two_id => NonPolyTwo.random_element.id)
+ PaintColor.create!(:non_poly_one_id => NonPolyOne.sample.id)
+ PaintTexture.create!(:non_poly_two_id => NonPolyTwo.sample.id)
end
1.upto(NUM_SHAPE_EXPRESSIONS) do
- shape_type = [Circle, Square, Triangle].random_element
- paint_type = [PaintColor, PaintTexture].random_element
- ShapeExpression.create!(:shape_type => shape_type.to_s, :shape_id => shape_type.random_element.id,
- :paint_type => paint_type.to_s, :paint_id => paint_type.random_element.id)
+ shape_type = [Circle, Square, Triangle].sample
+ paint_type = [PaintColor, PaintTexture].sample
+ ShapeExpression.create!(:shape_type => shape_type.to_s, :shape_id => shape_type.sample.id,
+ :paint_type => paint_type.to_s, :paint_id => paint_type.sample.id)
end
end