aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator/generators/components/model/templates/fixtures.yml')
-rw-r--r--railties/lib/rails_generator/generators/components/model/templates/fixtures.yml4
1 files changed, 4 insertions, 0 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 c58dd85b00..c8a124f44f 100644
--- a/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml
+++ b/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml
@@ -4,12 +4,16 @@ one:
<% 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) %>
+<% end -%>