#2448: Add created_at and updated_at fields to the user model and display the creation date in user list

This commit is contained in:
Jyri-Petteri Paloposki 2020-08-07 21:03:51 +03:00
parent 15f7510cba
commit 8369bf9e96
2 changed files with 8 additions and 0 deletions

View file

@ -13,6 +13,7 @@
<th><%= t('users.total_contexts') %></th> <th><%= t('users.total_contexts') %></th>
<th><%= t('users.total_projects') %></th> <th><%= t('users.total_projects') %></th>
<th><%= t('users.total_notes') %></th> <th><%= t('users.total_notes') %></th>
<th><%= User.human_attribute_name('created_at') %></th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
<% for user in @users %> <% for user in @users %>
@ -26,6 +27,7 @@
<td><%= h user.contexts.size %></td> <td><%= h user.contexts.size %></td>
<td><%= h user.projects.size %></td> <td><%= h user.projects.size %></td>
<td><%= h user.notes.size %></td> <td><%= h user.notes.size %></td>
<td><%= format_date(user.created_at) %></td>
<td><%= !user.is_admin? ? remote_delete_user(user) : "&nbsp;".html_safe %></td> <td><%= !user.is_admin? ? remote_delete_user(user) : "&nbsp;".html_safe %></td>
</tr> </tr>
<% end %> <% end %>

View file

@ -0,0 +1,6 @@
class AddDatesToUser < ActiveRecord::Migration[5.2]
def change
add_column :users, :created_at, :datetime
add_column :users, :updated_at, :datetime
end
end