From 7d55141a1a41e252d93425cc22e5b4330fe55351 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 28 Dec 2014 21:34:36 +0100 Subject: [PATCH] added deleted column to reports --- app/views/moderation/index.html.haml | 2 +- db/migrate/20141228202825_add_deleted_to_reports.rb | 5 +++++ db/schema.rb | 9 +++++---- 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20141228202825_add_deleted_to_reports.rb diff --git a/app/views/moderation/index.html.haml b/app/views/moderation/index.html.haml index b4930b5e..f9f64d5e 100644 --- a/app/views/moderation/index.html.haml +++ b/app/views/moderation/index.html.haml @@ -2,5 +2,5 @@ .row = render 'moderation/moderation_tabs' .col-md-9.col-sm-9.col-xs-12 - - Report.all.reverse_order.each do |r| + - Report.where(deleted: false).reverse_order.each do |r| = render 'moderation/moderationbox', report: r \ No newline at end of file diff --git a/db/migrate/20141228202825_add_deleted_to_reports.rb b/db/migrate/20141228202825_add_deleted_to_reports.rb new file mode 100644 index 00000000..e8dbab4a --- /dev/null +++ b/db/migrate/20141228202825_add_deleted_to_reports.rb @@ -0,0 +1,5 @@ +class AddDeletedToReports < ActiveRecord::Migration + def change + add_column :reports, :deleted, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 6bf9a23c..a939558f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20141227130618) do +ActiveRecord::Schema.define(version: 20141228202825) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -102,11 +102,12 @@ ActiveRecord::Schema.define(version: 20141227130618) do add_index "relationships", ["target_id"], name: "index_relationships_on_target_id", using: :btree create_table "reports", force: true do |t| - t.string "type", null: false - t.integer "target_id", null: false - t.integer "user_id", null: false + t.string "type", null: false + t.integer "target_id", null: false + t.integer "user_id", null: false t.datetime "created_at" t.datetime "updated_at" + t.boolean "deleted", default: false end create_table "services", force: true do |t|