aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2009-03-22 23:57:24 +0200
committerRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2009-08-06 23:40:59 +0300
commit5666a3ad065469f12e5b3a4de0be823c9ae4ff7d (patch)
tree6ba9b619af7e860a50fcac66aa751f88eafa7d90 /activerecord/test/models
parent963570b51ce4d95b046a441dd1c413dc6fcec8b4 (diff)
downloadrails-5666a3ad065469f12e5b3a4de0be823c9ae4ff7d.tar.gz
rails-5666a3ad065469f12e5b3a4de0be823c9ae4ff7d.tar.bz2
rails-5666a3ad065469f12e5b3a4de0be823c9ae4ff7d.zip
added :order option to find :first methods and associations as otherwise Oracle tests were failing
Oracle stores '' string as NULL Oracle cannot have identifiers larger than 30 characters added missing fixtures to test setup method
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/company.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index 22168468a6..1c05e523e0 100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -73,12 +73,16 @@ class Firm < Company
has_one :unvalidated_account, :foreign_key => "firm_id", :class_name => 'Account', :validate => false
has_one :account_with_select, :foreign_key => "firm_id", :select => "id, firm_id", :class_name=>'Account'
has_one :readonly_account, :foreign_key => "firm_id", :class_name => "Account", :readonly => true
- has_one :account_using_primary_key, :primary_key => "firm_id", :class_name => "Account"
+ # added order by id as in fixtures there are two accounts for Rails Core
+ # Oracle tests were failing because of that as the second fixture was selected
+ has_one :account_using_primary_key, :primary_key => "firm_id", :class_name => "Account", :order => "id"
has_one :deletable_account, :foreign_key => "firm_id", :class_name => "Account", :dependent => :delete
end
class DependentFirm < Company
- has_one :account, :foreign_key => "firm_id", :dependent => :nullify
+ # added order by id as in fixtures there are two accounts for Rails Core
+ # Oracle tests were failing because of that as the second fixture was selected
+ has_one :account, :foreign_key => "firm_id", :dependent => :nullify, :order => "id"
has_many :companies, :foreign_key => 'client_of', :order => "id", :dependent => :nullify
end