Add test_procedure to procedure_path

This commit is contained in:
Paul Chavard 2018-05-17 15:31:45 +02:00
parent 5b094d8b13
commit 4ad3932c05
3 changed files with 9 additions and 1 deletions

View file

@ -3,6 +3,7 @@ class ProcedurePath < ApplicationRecord
validates :administrateur_id, presence: true, allow_blank: false, allow_nil: false
validates :procedure_id, presence: true, allow_blank: false, allow_nil: false
belongs_to :test_procedure, class_name: 'Procedure'
belongs_to :procedure
belongs_to :administrateur
end

View file

@ -0,0 +1,5 @@
class AddTestProcedureToProcedurePaths < ActiveRecord::Migration[5.2]
def change
add_reference :procedure_paths, :test_procedure
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2018_05_15_135415) do
ActiveRecord::Schema.define(version: 2018_05_16_155238) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -425,7 +425,9 @@ ActiveRecord::Schema.define(version: 2018_05_15_135415) do
t.integer "administrateur_id"
t.datetime "created_at"
t.datetime "updated_at"
t.bigint "test_procedure_id"
t.index ["path"], name: "index_procedure_paths_on_path"
t.index ["test_procedure_id"], name: "index_procedure_paths_on_test_procedure_id"
end
create_table "procedure_presentations", id: :serial, force: :cascade do |t|