From 6cc0b9638fbb6ede3c46b51d7dab17881416014c Mon Sep 17 00:00:00 2001 From: Eloy Duran Date: Sat, 11 Jul 2009 17:52:13 +0200 Subject: Explicitely setting `autosave => false' should override new_record autosaving. [#2214 state:resolved] Original author is Jacob. --- activerecord/test/models/company.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test/models/company.rb') diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index 9242c209ea..d69152ec34 100644 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -79,6 +79,10 @@ class Firm < Company # Oracle tests were failing because of that as the second fixture was selected has_one :account_using_primary_key, :primary_key => "firm_id", :class_name => "Account", :order => "id" has_one :deletable_account, :foreign_key => "firm_id", :class_name => "Account", :dependent => :delete + + has_one :unautosaved_account, :foreign_key => "firm_id", :class_name => 'Account', :autosave => false + has_many :accounts + has_many :unautosaved_accounts, :foreign_key => "firm_id", :class_name => 'Account', :autosave => false end class DependentFirm < Company @@ -149,6 +153,7 @@ end class Account < ActiveRecord::Base belongs_to :firm + belongs_to :unautosaved_firm, :foreign_key => "firm_id", :class_name => "Firm", :autosave => false def self.destroyed_account_ids @destroyed_account_ids ||= Hash.new { |h,k| h[k] = [] } -- cgit v1.2.3