aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/fixtures.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index b01444a090..d062dd9e34 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -645,7 +645,9 @@ module ActiveRecord
# Resolve enums
model_class.defined_enums.each do |name, values|
- row[name] = values.fetch(row[name], row[name])
+ if row.include?(name)
+ row[name] = values.fetch(row[name], row[name])
+ end
end
# If STI is used, find the correct subclass for association reflection