aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/fixtures.rb2
-rw-r--r--activerecord/test/cases/fixtures_test.rb2
-rw-r--r--activerecord/test/models/parrot.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 1724fa893d..4044f5f7b2 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -661,7 +661,7 @@ module ActiveRecord
row[association.foreign_type] = $1
end
- fk_type = association.active_record.columns_hash[association.foreign_key].type
+ fk_type = association.active_record.columns_hash[fk_name].type
row[fk_name] = ActiveRecord::FixtureSet.identify(value, fk_type)
end
when :has_many
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index 385ec48005..1050047a43 100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
@@ -675,7 +675,7 @@ class FoxyFixturesTest < ActiveRecord::TestCase
if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
require 'models/uuid_parent'
require 'models/uuid_child'
- fixtures :uuid_parents, :uuid_children
+ fixtures :uuid_parents, :uuid_children
end
def test_identifies_strings
diff --git a/activerecord/test/models/parrot.rb b/activerecord/test/models/parrot.rb
index e76e83f314..8c83de573f 100644
--- a/activerecord/test/models/parrot.rb
+++ b/activerecord/test/models/parrot.rb
@@ -19,7 +19,7 @@ class LiveParrot < Parrot
end
class DeadParrot < Parrot
- belongs_to :killer, :class_name => 'Pirate'
+ belongs_to :killer, :class_name => 'Pirate', foreign_key: :killer_id
end
class FunkyParrot < Parrot