mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-21 21:40:48 +02:00
Merge pull request #2449 from TracksApp/feature/2448_user_dates
#2448: Add created_at and updated_at fields to the user model and dis…
This commit is contained in:
commit
950da89d76
3 changed files with 11 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
<th><%= t('users.total_contexts') %></th>
|
||||
<th><%= t('users.total_projects') %></th>
|
||||
<th><%= t('users.total_notes') %></th>
|
||||
<th><%= User.human_attribute_name('created_at') %></th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
<% for user in @users %>
|
||||
|
@ -26,6 +27,7 @@
|
|||
<td><%= h user.contexts.size %></td>
|
||||
<td><%= h user.projects.size %></td>
|
||||
<td><%= h user.notes.size %></td>
|
||||
<td><%= format_date(user.created_at) %></td>
|
||||
<td><%= !user.is_admin? ? remote_delete_user(user) : " ".html_safe %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
6
db/migrate/20200807175610_add_dates_to_user.rb
Normal file
6
db/migrate/20200807175610_add_dates_to_user.rb
Normal 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
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2020_07_20_151220) do
|
||||
ActiveRecord::Schema.define(version: 2020_08_07_175610) do
|
||||
|
||||
create_table "attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
||||
t.integer "todo_id"
|
||||
|
@ -221,6 +221,8 @@ ActiveRecord::Schema.define(version: 2020_07_20_151220) do
|
|||
t.string "remember_token"
|
||||
t.datetime "remember_token_expires_at"
|
||||
t.string "email"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.index ["login"], name: "index_users_on_login"
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue