diff options
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/company_in_module.rb | 12 | ||||
-rw-r--r-- | activerecord/test/fixtures/post.rb | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/activerecord/test/fixtures/company_in_module.rb b/activerecord/test/fixtures/company_in_module.rb index 7372134ae9..1eb2b2bd93 100644 --- a/activerecord/test/fixtures/company_in_module.rb +++ b/activerecord/test/fixtures/company_in_module.rb @@ -46,11 +46,13 @@ module MyApplication end class Account < ActiveRecord::Base - belongs_to :firm, :class_name => 'MyApplication::Business::Firm' - belongs_to :qualified_billing_firm, :class_name => 'MyApplication::Billing::Firm' - belongs_to :unqualified_billing_firm, :class_name => 'Firm' - belongs_to :nested_qualified_billing_firm, :class_name => 'MyApplication::Billing::Nested::Firm' - belongs_to :nested_unqualified_billing_firm, :class_name => 'Nested::Firm' + with_options(:foreign_key => :firm_id) do |i| + i.belongs_to :firm, :class_name => 'MyApplication::Business::Firm' + i.belongs_to :qualified_billing_firm, :class_name => 'MyApplication::Billing::Firm' + i.belongs_to :unqualified_billing_firm, :class_name => 'Firm' + i.belongs_to :nested_qualified_billing_firm, :class_name => 'MyApplication::Billing::Nested::Firm' + i.belongs_to :nested_unqualified_billing_firm, :class_name => 'Nested::Firm' + end protected def validate diff --git a/activerecord/test/fixtures/post.rb b/activerecord/test/fixtures/post.rb index 9b42fbdb27..9dc18441d0 100644 --- a/activerecord/test/fixtures/post.rb +++ b/activerecord/test/fixtures/post.rb @@ -5,7 +5,7 @@ class Post < ActiveRecord::Base end end - belongs_to :author_with_posts, :class_name => "Author", :include => :posts + belongs_to :author_with_posts, :class_name => "Author", :foreign_key => :author_id, :include => :posts has_many :comments, :order => "body" do def find_most_recent |