aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorWill Bryant <will.bryant@gmail.com>2014-09-08 23:32:42 +1200
committerArthur Neves <arthurnn@gmail.com>2014-09-22 13:10:55 -0400
commit2a1b45af56d6c0ec39941c50ff98bf2e6d74d274 (patch)
treef69bae4e6dee2c28d04680c2a63b0712b520ad96 /activerecord/lib/active_record
parent4dfbfc7c27085ec9118522c9298e51d9918c7895 (diff)
downloadrails-2a1b45af56d6c0ec39941c50ff98bf2e6d74d274.tar.gz
rails-2a1b45af56d6c0ec39941c50ff98bf2e6d74d274.tar.bz2
rails-2a1b45af56d6c0ec39941c50ff98bf2e6d74d274.zip
fix fixtures not loading if a belongs_to association is defined with a :foreign_key option that's a symbol
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/fixtures.rb2
1 files changed, 1 insertions, 1 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