diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-28 09:20:05 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-28 09:20:05 +0000 |
commit | e508595cf70d6ebd057d8bfa6f2cd25a119cda3f (patch) | |
tree | 35a6961855234dbb3fa376b7f22ca1d22ad237f0 /activerecord/test | |
parent | 9bafd3537554d07b96b9edf049ff48ce262c30ac (diff) | |
download | rails-e508595cf70d6ebd057d8bfa6f2cd25a119cda3f.tar.gz rails-e508595cf70d6ebd057d8bfa6f2cd25a119cda3f.tar.bz2 rails-e508595cf70d6ebd057d8bfa6f2cd25a119cda3f.zip |
Fixed SQL Server adapter so it honors options[:conditions] when applying :limits (closes #1978) [Tom Ward] Fixed SQL Server adapter to pass even more tests and do even better (closes #2634) [rtomayko@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2781 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/finder_test.rb | 6 | ||||
-rw-r--r-- | activerecord/test/fixtures/db_definitions/sqlserver.drop.sql | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb index bfaed76a56..7c30308a48 100644 --- a/activerecord/test/finder_test.rb +++ b/activerecord/test/finder_test.rb @@ -56,6 +56,12 @@ class FinderTest < Test::Unit::TestCase assert_equal(1, entrants.size) assert_equal(entrants(:third).name, entrants.first.name) end + + def test_find_with_limit_and_condition + developers = Developer.find(:all, :order => "id DESC", :conditions => "salary = 100000", :limit => 3, :offset =>7) + assert_equal(1, developers.size) + assert_equal("fixture_3", developers.first.name) + end def test_find_with_entire_select_statement topics = Topic.find_by_sql "SELECT * FROM topics WHERE author_name = 'Mary'" diff --git a/activerecord/test/fixtures/db_definitions/sqlserver.drop.sql b/activerecord/test/fixtures/db_definitions/sqlserver.drop.sql index 4d78d6fda1..edb9aa6e8d 100644 --- a/activerecord/test/fixtures/db_definitions/sqlserver.drop.sql +++ b/activerecord/test/fixtures/db_definitions/sqlserver.drop.sql @@ -22,6 +22,6 @@ DROP TABLE authors; DROP TABLE tasks; DROP TABLE categories; DROP TABLE categories_posts; -DROP TABLE fk_test_has_pd; DROP TABLE fk_test_has_fk; +DROP TABLE fk_test_has_pk; DROP TABLE keyboards; |