aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/company.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/company.rb')
-rw-r--r--activerecord/test/models/company.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index d4d5275b78..485b35d58b 100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -204,4 +204,12 @@ end
class VerySpecialClient < SpecialClient
end
+class NewlyContractedCompany < Company
+ has_many :new_contracts, foreign_key: "company_id"
+
+ before_save do
+ self.new_contracts << NewContract.new
+ end
+end
+
require "models/account"