aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/company.rb
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2005-10-15 00:46:55 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2005-10-15 00:46:55 +0000
commit70869931611667d5b732ae91704313115e4baa10 (patch)
tree27e1df63f6953b9a8484aaa1859152fa0fb2490e /activerecord/test/fixtures/company.rb
parent64fcb752f2c2f337918f74cd0cc6049a4cafb7a6 (diff)
downloadrails-70869931611667d5b732ae91704313115e4baa10.tar.gz
rails-70869931611667d5b732ae91704313115e4baa10.tar.bz2
rails-70869931611667d5b732ae91704313115e4baa10.zip
Adds :nullify option to :depends. Closes #2015 (Robby Russell)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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