Avis: add confidentiel field

This commit is contained in:
Simon Lehericey 2017-09-08 11:52:20 +02:00
parent 112e3a5793
commit f55c7a0512
3 changed files with 15 additions and 4 deletions

View file

@ -0,0 +1,5 @@
class AddConfidentielFieldToAvis < ActiveRecord::Migration[5.0]
def change
add_column :avis, :confidentiel, :boolean, default: false, null: false
end
end

View file

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170801083632) do ActiveRecord::Schema.define(version: 20170908101023) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -102,6 +102,7 @@ ActiveRecord::Schema.define(version: 20170801083632) do
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.integer "claimant_id", null: false t.integer "claimant_id", null: false
t.boolean "confidentiel", default: false, null: false
t.index ["claimant_id"], name: "index_avis_on_claimant_id", using: :btree t.index ["claimant_id"], name: "index_avis_on_claimant_id", using: :btree
t.index ["dossier_id"], name: "index_avis_on_dossier_id", using: :btree t.index ["dossier_id"], name: "index_avis_on_dossier_id", using: :btree
t.index ["gestionnaire_id"], name: "index_avis_on_gestionnaire_id", using: :btree t.index ["gestionnaire_id"], name: "index_avis_on_gestionnaire_id", using: :btree

View file

@ -0,0 +1,5 @@
namespace :'2017_09_19_set_confidentialite_to_old_avis' do
task set: :environment do
Avis.unscoped.update_all(confidentiel: true)
end
end