mostrar notificaciones a los usuarios cuando alguien comenta en su
debate o responde a su comentario
This commit is contained in:
9
db/migrate/20150928115005_create_notifications.rb
Normal file
9
db/migrate/20150928115005_create_notifications.rb
Normal 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
|
||||
13
db/schema.rb
13
db/schema.rb
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user