Skip to content

Commit

Permalink
Use select and change test so new tests can work on postgres.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Koziarski <michael@koziarski.com>
  • Loading branch information
miloops authored and NZKoz committed Sep 12, 2008
1 parent a37c5ae commit 646b5bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions activerecord/test/cases/finder_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ def test_find_with_limit_and_condition
end end


def test_find_with_group 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.size
assert_equal 4, developers.uniq(&:salary).size assert_equal 4, developers.map(&:salary).uniq.size
end end


def test_find_with_entire_select_statement def test_find_with_entire_select_statement
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/models/category.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Category < ActiveRecord::Base
:class_name => 'Post', :class_name => 'Post',
:conditions => { :title => 'Yet Another Testing Title' } :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 def self.what_are_you
'a category...' 'a category...'
Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/models/company.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class Firm < Company
has_many :readonly_clients, :class_name => 'Client', :readonly => true has_many :readonly_clients, :class_name => 'Client', :readonly => true
has_many :clients_using_primary_key, :class_name => 'Client', has_many :clients_using_primary_key, :class_name => 'Client',
:primary_key => 'name', :foreign_key => 'firm_name' :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_firm_id, :class_name => "Client", :group => "firm_id", :select => "firm_id"
has_many :clients_grouped_by_name, :class_name => "Client", :group => "name" 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 :account, :foreign_key => "firm_id", :dependent => :destroy, :validate => true
has_one :unvalidated_account, :foreign_key => "firm_id", :class_name => 'Account', :validate => false has_one :unvalidated_account, :foreign_key => "firm_id", :class_name => 'Account', :validate => false
Expand Down

0 comments on commit 646b5bf

Please sign in to comment.