aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/company.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-03-28 11:06:46 -0700
committerwycats <wycats@gmail.com>2010-03-28 11:06:46 -0700
commitc99194c7bed6744104e114ab231ef39158044a63 (patch)
tree9566ad06335bf96d4c32e421c2d25b4676b3e0d3 /activerecord/test/models/company.rb
parent835f5d0269a8d3615585119e77f1ba7d601c943b (diff)
parentf1e5a9ff982998c31c9dedf2fa79180c7dea820a (diff)
downloadrails-c99194c7bed6744104e114ab231ef39158044a63.tar.gz
rails-c99194c7bed6744104e114ab231ef39158044a63.tar.bz2
rails-c99194c7bed6744104e114ab231ef39158044a63.zip
Merge remote branch 'rizwan/restrict'
Diffstat (limited to 'activerecord/test/models/company.rb')
-rw-r--r--activerecord/test/models/company.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index f31d5f87e5..be6dd71e3b 100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -95,6 +95,11 @@ class DependentFirm < Company
has_many :companies, :foreign_key => 'client_of', :dependent => :nullify
end
+class RestrictedFirm < Company
+ has_one :account, :foreign_key => "firm_id", :dependent => :restrict, :order => "id"
+ has_many :companies, :foreign_key => 'client_of', :order => "id", :dependent => :restrict
+end
+
class Client < Company
belongs_to :firm, :foreign_key => "client_of"
belongs_to :firm_with_basic_id, :class_name => "Firm", :foreign_key => "firm_id"