mostrar notificaciones a los usuarios cuando alguien comenta en su

debate o responde a su comentario
This commit is contained in:
Julian Herrero
2015-10-06 12:11:20 +02:00
committed by rgarcia
parent ba0ce4e14b
commit d9ba3edc2a
17 changed files with 304 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
class CreateNotifications < ActiveRecord::Migration
def change
create_table :notifications do |t|
t.belongs_to :user, index: true, foreign_key: true
t.belongs_to :activity, index: true, foreign_key: true
t.boolean :read, default: false
end
end
end

View File

@@ -204,6 +204,17 @@ ActiveRecord::Schema.define(version: 20151215165824) do
add_index "moderators", ["user_id"], name: "index_moderators_on_user_id", using: :btree
create_table "notifications", force: :cascade do |t|
t.integer "user_id"
t.integer "activity_id"
t.boolean "read", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "notifications", ["activity_id"], name: "index_notifications_on_activity_id", using: :btree
add_index "notifications", ["user_id"], name: "index_notifications_on_user_id", using: :btree
create_table "organizations", force: :cascade do |t|
t.integer "user_id"
t.string "name", limit: 60
@@ -405,5 +416,7 @@ ActiveRecord::Schema.define(version: 20151215165824) do
add_foreign_key "identities", "users"
add_foreign_key "locks", "users"
add_foreign_key "moderators", "users"
add_foreign_key "notifications", "activities"
add_foreign_key "notifications", "users"
add_foreign_key "organizations", "users"
end