From 646b5bfa61f8e803d98bd1557c53ea961cc6b16d Mon Sep 17 00:00:00 2001 From: miloops Date: Thu, 11 Sep 2008 19:14:06 -0300 Subject: Use select and change test so new tests can work on postgres. Signed-off-by: Michael Koziarski --- activerecord/test/cases/finder_test.rb | 4 ++-- activerecord/test/models/category.rb | 2 +- activerecord/test/models/company.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index ddfebaec08..cbdff382fe 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -170,9 +170,9 @@ class FinderTest < ActiveRecord::TestCase end def test_find_with_group - developers = Developer.find(:all, :group => "salary") + developers = Developer.find(:all, :group => "salary", :select => "salary") assert_equal 4, developers.size - assert_equal 4, developers.uniq(&:salary).size + assert_equal 4, developers.map(&:salary).uniq.size end def test_find_with_entire_select_statement diff --git a/activerecord/test/models/category.rb b/activerecord/test/models/category.rb index a06dd78011..4e9d247a4e 100644 --- a/activerecord/test/models/category.rb +++ b/activerecord/test/models/category.rb @@ -14,7 +14,7 @@ class Category < ActiveRecord::Base :class_name => 'Post', :conditions => { :title => 'Yet Another Testing Title' } - has_and_belongs_to_many :posts_gruoped_by_title, :class_name => "Post", :group => "title" + has_and_belongs_to_many :posts_gruoped_by_title, :class_name => "Post", :group => "title", :select => "title" def self.what_are_you 'a category...' diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index 1abf3f3918..0eb8ae0a15 100644 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -55,8 +55,8 @@ class Firm < Company has_many :readonly_clients, :class_name => 'Client', :readonly => true has_many :clients_using_primary_key, :class_name => 'Client', :primary_key => 'name', :foreign_key => 'firm_name' - has_many :clients_grouped_by_firm_id, :class_name => "Client", :group => "firm_id" - has_many :clients_grouped_by_name, :class_name => "Client", :group => "name" + has_many :clients_grouped_by_firm_id, :class_name => "Client", :group => "firm_id", :select => "firm_id" + has_many :clients_grouped_by_name, :class_name => "Client", :group => "name", :select => "name" has_one :account, :foreign_key => "firm_id", :dependent => :destroy, :validate => true has_one :unvalidated_account, :foreign_key => "firm_id", :class_name => 'Account', :validate => false -- cgit v1.2.3