public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Use select and change test so new tests can work on postgres.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
miloops (author)
Thu Sep 11 15:14:06 -0700 2008
NZKoz (committer)
Fri Sep 12 03:27:03 -0700 2008
commit  646b5bfa61f8e803d98bd1557c53ea961cc6b16d
tree    a193f7d5b50ab36f0860daf834775a956a8940e0
parent  a37c5ae961366e3d693991b51d0830d40ae37e08
...
170
171
172
173
 
174
175
 
176
177
178
...
170
171
172
 
173
174
 
175
176
177
178
0
@@ -170,9 +170,9 @@ class FinderTest < ActiveRecord::TestCase
0
   end
0
 
0
   def test_find_with_group
0
-    developers =  Developer.find(:all, :group => "salary")
0
+    developers =  Developer.find(:all, :group => "salary", :select => "salary")
0
     assert_equal 4, developers.size
0
-    assert_equal 4, developers.uniq(&:salary).size
0
+    assert_equal 4, developers.map(&:salary).uniq.size
0
   end
0
 
0
   def test_find_with_entire_select_statement
...
14
15
16
17
 
18
19
20
...
14
15
16
 
17
18
19
20
0
@@ -14,7 +14,7 @@ class Category < ActiveRecord::Base
0
                           :class_name => 'Post',
0
                           :conditions => { :title => 'Yet Another Testing Title' }
0
 
0
-  has_and_belongs_to_many :posts_gruoped_by_title, :class_name => "Post", :group => "title"
0
+  has_and_belongs_to_many :posts_gruoped_by_title, :class_name => "Post", :group => "title", :select => "title"
0
 
0
   def self.what_are_you
0
     'a category...'
...
55
56
57
58
59
 
 
60
61
62
...
55
56
57
 
 
58
59
60
61
62
0
@@ -55,8 +55,8 @@ class Firm < Company
0
   has_many :readonly_clients, :class_name => 'Client', :readonly => true
0
   has_many :clients_using_primary_key, :class_name => 'Client',
0
            :primary_key => 'name', :foreign_key => 'firm_name'
0
-  has_many :clients_grouped_by_firm_id, :class_name => "Client", :group => "firm_id"
0
-  has_many :clients_grouped_by_name, :class_name => "Client", :group => "name"
0
+  has_many :clients_grouped_by_firm_id, :class_name => "Client", :group => "firm_id", :select => "firm_id"
0
+  has_many :clients_grouped_by_name, :class_name => "Client", :group => "name", :select => "name"
0
 
0
   has_one :account, :foreign_key => "firm_id", :dependent => :destroy, :validate => true
0
   has_one :unvalidated_account, :foreign_key => "firm_id", :class_name => 'Account', :validate => false

Comments