aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/finder_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/finder_test.rb')
-rw-r--r--activerecord/test/finder_test.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb
index 8fc89f3808..35c96288fe 100644
--- a/activerecord/test/finder_test.rb
+++ b/activerecord/test/finder_test.rb
@@ -3,9 +3,10 @@ require 'fixtures/company'
require 'fixtures/topic'
require 'fixtures/entrant'
require 'fixtures/developer'
+require 'fixtures/post'
class FinderTest < Test::Unit::TestCase
- fixtures :companies, :topics, :entrants, :developers
+ fixtures :companies, :topics, :entrants, :developers, :posts
def test_find
assert_equal(topics(:first).title, Topic.find(1).title)
@@ -311,6 +312,13 @@ class FinderTest < Test::Unit::TestCase
assert developer_names.include?('Jamis')
end
+ def test_find_by_id_with_conditions_with_or
+ assert_nothing_raised do
+ Post.find([1,2,3],
+ :conditions => "posts.id <= 3 OR posts.type = 'Post'")
+ end
+ end
+
def test_select_value
assert_equal "37signals", Company.connection.select_value("SELECT name FROM companies WHERE id = 1")
assert_nil Company.connection.select_value("SELECT name FROM companies WHERE id = -1")