aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-12 14:45:30 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-26 13:44:07 -0700
commit6ceffb8178b6d419d4453e1e24d4138215c35217 (patch)
treed515d468eb93b6930bdf54aa57b85540e9c3d9dd /activerecord/test
parent497218d5db8f7c3887c3861bdbe318331b77fed7 (diff)
downloadrails-6ceffb8178b6d419d4453e1e24d4138215c35217.tar.gz
rails-6ceffb8178b6d419d4453e1e24d4138215c35217.tar.bz2
rails-6ceffb8178b6d419d4453e1e24d4138215c35217.zip
adding bind_values to relations
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index b01a8bbef1..d2ccc1480a 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -19,6 +19,15 @@ class RelationTest < ActiveRecord::TestCase
fixtures :authors, :topics, :entrants, :developers, :companies, :developers_projects, :accounts, :categories, :categorizations, :posts, :comments,
:taggings, :cars
+ def test_bind_values
+ relation = Post.scoped
+ assert_equal [], relation.bind_values
+
+ relation2 = relation.bind 'foo'
+ assert_equal %w{ foo }, relation2.bind_values
+ assert_equal [], relation.bind_values
+ end
+
def test_two_named_scopes_with_includes_should_not_drop_any_include
car = Car.incl_engines.incl_tyres.first
assert_no_queries { car.tyres.length }