aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r--activerecord/test/fixtures/accounts.yml5
-rw-r--r--activerecord/test/fixtures/companies.yml12
-rwxr-xr-xactiverecord/test/fixtures/company.rb8
3 files changed, 24 insertions, 1 deletions
diff --git a/activerecord/test/fixtures/accounts.yml b/activerecord/test/fixtures/accounts.yml
index 21a0aab52a..8cff4389fd 100644
--- a/activerecord/test/fixtures/accounts.yml
+++ b/activerecord/test/fixtures/accounts.yml
@@ -6,3 +6,8 @@ signals37:
unknown:
id: 2
credit_limit: 50
+
+rails_core_account:
+ id: 3
+ firm_id: 6
+ credit_limit: 50
diff --git a/activerecord/test/fixtures/companies.yml b/activerecord/test/fixtures/companies.yml
index 7d13bc6b75..29b949e16b 100644
--- a/activerecord/test/fixtures/companies.yml
+++ b/activerecord/test/fixtures/companies.yml
@@ -33,3 +33,15 @@ another_client:
client_of: 4
name: Ex Nihilo
ruby_type: Client
+
+rails_core:
+ id: 6
+ type: DependentFirm
+
+leetsoft:
+ id: 7
+ client_of: 6
+
+jadedpixel:
+ id: 8
+ client_of: 6 \ No newline at end of file
diff --git a/activerecord/test/fixtures/company.rb b/activerecord/test/fixtures/company.rb
index 748d43eb2e..4a0c96bdd3 100755
--- a/activerecord/test/fixtures/company.rb
+++ b/activerecord/test/fixtures/company.rb
@@ -27,6 +27,12 @@ class Firm < Company
has_one :account, :foreign_key => "firm_id", :dependent => true
end
+class DependentFirm < Company
+ has_one :account, :foreign_key => "firm_id", :dependent => :nullify
+ has_many :companies, :foreign_key => 'client_of', :order => "id", :dependent => :nullify
+end
+
+
class Client < Company
belongs_to :firm, :foreign_key => "client_of"
belongs_to :firm_with_basic_id, :class_name => "Firm", :foreign_key => "firm_id"
@@ -62,4 +68,4 @@ class Account < ActiveRecord::Base
def validate
errors.add_on_empty "credit_limit"
end
-end
+end \ No newline at end of file