aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r--railties/lib/rails/generators/test_unit/model/templates/fixtures.yml4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml b/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml
index 5c8780aa64..71f4f99d02 100644
--- a/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml
+++ b/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml
@@ -3,12 +3,12 @@
<% unless attributes.empty? -%>
one:
<% attributes.each do |attribute| -%>
- <%= attribute.name %>: <%= attribute.default %>
+ <%= attribute.reference? ? "#{attribute.name}_id" : attribute.name %>: <%= attribute.default %>
<% end -%>
two:
<% attributes.each do |attribute| -%>
- <%= attribute.name %>: <%= attribute.default %>
+ <%= attribute.reference? ? "#{attribute.name}_id" : attribute.name %>: <%= attribute.default %>
<% end -%>
<% else -%>
# This model initially had no columns defined. If you add columns to the