Extend notifications to be marked as read and unread

This commit is contained in:
rgarcia
2018-02-27 14:47:52 +01:00
parent c4ad9b940c
commit 09c44ee583
22 changed files with 445 additions and 141 deletions

View File

@@ -0,0 +1,5 @@
class AddReadAtToNotifications < ActiveRecord::Migration
def change
add_column :notifications, :read_at, :timestamp
end
end

View File

@@ -12,7 +12,6 @@
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180320104823) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "unaccent"
@@ -640,6 +639,7 @@ ActiveRecord::Schema.define(version: 20180320104823) do
t.string "notifiable_type"
t.integer "counter", default: 1
t.datetime "emailed_at"
t.datetime "read_at"
end
add_index "notifications", ["user_id"], name: "index_notifications_on_user_id", using: :btree