aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/company.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/fixtures/company.rb')
-rwxr-xr-xactiverecord/test/fixtures/company.rb8
1 files changed, 7 insertions, 1 deletions
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