aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/finder_test.rb
diff options
context:
space:
mode:
authorrick <rick@spacemonkey.local>2008-05-10 17:46:55 -0700
committerrick <rick@spacemonkey.local>2008-05-10 17:46:55 -0700
commitd09a8446d5606a5a0b5c024224b09a1318e9cf4d (patch)
tree199ef3554f731c980ea5726e67e34af4ea057c2e /activerecord/test/cases/finder_test.rb
parentc8451aeeea200043d8a3e6eae9c49def3a154ddb (diff)
parenta7ea06b4ebe252e258f83e7de945b4baa30ec3bc (diff)
downloadrails-d09a8446d5606a5a0b5c024224b09a1318e9cf4d.tar.gz
rails-d09a8446d5606a5a0b5c024224b09a1318e9cf4d.tar.bz2
rails-d09a8446d5606a5a0b5c024224b09a1318e9cf4d.zip
fix merge conflict with actionpack changelog
Diffstat (limited to 'activerecord/test/cases/finder_test.rb')
-rw-r--r--activerecord/test/cases/finder_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index b7f87fe6e8..2acfe9b387 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -8,6 +8,7 @@ require 'models/entrant'
require 'models/developer'
require 'models/post'
require 'models/customer'
+require 'models/job'
class FinderTest < ActiveRecord::TestCase
fixtures :companies, :topics, :entrants, :developers, :developers_projects, :posts, :comments, :accounts, :authors, :customers
@@ -857,6 +858,14 @@ class FinderTest < ActiveRecord::TestCase
Company.connection.select_rows("SELECT id, name FROM companies WHERE id IN (1,2,3) ORDER BY id").map! {|i| i.map! {|j| j.to_s unless j.nil?}}
end
+ def test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct
+ assert_equal 2, Post.find(:all,:include=>{:authors=>:author_address},:order=>' author_addresses.id DESC ', :limit=>2).size
+
+ assert_equal 3, Post.find(:all,:include=>{:author=>:author_address,:authors=>:author_address},
+ :order=>' author_addresses_authors.id DESC ', :limit=>3).size
+ end
+
+
protected
def bind(statement, *vars)
if vars.first.is_a?(Hash)