aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/generators/components/model/templates
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator/generators/components/model/templates')
-rw-r--r--railties/lib/rails_generator/generators/components/model/templates/fixtures.yml18
1 files changed, 9 insertions, 9 deletions
diff --git a/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml b/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml
index c8a124f44f..c21035113e 100644
--- a/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml
+++ b/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml
@@ -1,19 +1,19 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+<% unless attributes.empty? -%>
one:
- <%= class_name.constantize.primary_key %>: 1
<% for attribute in attributes -%>
<%= attribute.name %>: <%= attribute.default %>
<% end -%>
-<% unless options[:skip_timestamps] -%>
- created_at: <%= Time.now.to_s(:db) %>
- updated_at: <%= Time.now.to_s(:db) %>
-<% end -%>
+
two:
- <%= class_name.constantize.primary_key %>: 2
<% for attribute in attributes -%>
<%= attribute.name %>: <%= attribute.default %>
<% end -%>
-<% unless options[:skip_timestamps] -%>
- created_at: <%= Time.now.to_s(:db) %>
- updated_at: <%= Time.now.to_s(:db) %>
+<% else -%>
+# one:
+# column: value
+#
+# two:
+# column: value
<% end -%>