lib/generators/rom/commands/templates/create.rb.erb in rom-rails-0.9.0 vs lib/generators/rom/commands/templates/create.rb.erb in rom-rails-1.0.0.beta1
- old
+ new
@@ -1,13 +1,11 @@
class Create<%= model_name %> < ROM::Commands::Create<%= "[:#{adapter}]" %>
relation :<%= relation %>
register_as :create
result :one
- # Modify input data before committing it.
- # before :timestamp
-
- # def timestamp(tuple)
- # time = Time.current
- # tuple.merge(created_at: time, updated_at: time)
- # end
+<% if adapter.to_sym == :sql -%>
+ # set Timestamp plugin
+ # use :timestamps
+ # timestamp :created_at, :updated_at
+<% end -%>
end