diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-13 23:21:14 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-13 23:21:14 +0000 |
commit | f7c371dff8021de8e2389580bb96b0cfdca3c9ec (patch) | |
tree | d6d698b4129a2ecdc5efee6267bb5332319baad4 /activerecord/test/associations | |
parent | 54a6ed148248b31bee5823d4dd55675edf018e34 (diff) | |
download | rails-f7c371dff8021de8e2389580bb96b0cfdca3c9ec.tar.gz rails-f7c371dff8021de8e2389580bb96b0cfdca3c9ec.tar.bz2 rails-f7c371dff8021de8e2389580bb96b0cfdca3c9ec.zip |
OpenBase: update for new lib and latest Rails. Support migrations. Closes #8748.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7472 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations')
-rw-r--r-- | activerecord/test/associations/eager_test.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/activerecord/test/associations/eager_test.rb b/activerecord/test/associations/eager_test.rb index 019d361f3d..bbf3edd0c9 100644 --- a/activerecord/test/associations/eager_test.rb +++ b/activerecord/test/associations/eager_test.rb @@ -135,13 +135,21 @@ class EagerAssociationTest < Test::Unit::TestCase end def test_eager_with_has_many_and_limit_and_conditions - posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :conditions => "posts.body = 'hello'", :order => "posts.id") + if current_adapter?(:OpenBaseAdapter) + posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :conditions => "FETCHBLOB(posts.body) = 'hello'", :order => "posts.id") + else + posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :conditions => "posts.body = 'hello'", :order => "posts.id") + end assert_equal 2, posts.size assert_equal [4,5], posts.collect { |p| p.id } end def test_eager_with_has_many_and_limit_and_conditions_array - posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :conditions => [ "posts.body = ?", 'hello' ], :order => "posts.id") + if current_adapter?(:OpenBaseAdapter) + posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :conditions => [ "FETCHBLOB(posts.body) = ?", 'hello' ], :order => "posts.id") + else + posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :conditions => [ "posts.body = ?", 'hello' ], :order => "posts.id") + end assert_equal 2, posts.size assert_equal [4,5], posts.collect { |p| p.id } end @@ -399,6 +407,8 @@ class EagerAssociationTest < Test::Unit::TestCase def test_count_with_include if current_adapter?(:SQLServerAdapter, :SybaseAdapter) assert_equal 3, authors(:david).posts_with_comments.count(:conditions => "len(comments.body) > 15") + elsif current_adapter?(:OpenBaseAdapter) + assert_equal 3, authors(:david).posts_with_comments.count(:conditions => "length(FETCHBLOB(comments.body)) > 15") else assert_equal 3, authors(:david).posts_with_comments.count(:conditions => "length(comments.body) > 15") end |