Commit 9e487100 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Validate project and environment instead of only requiring

parent 14433b34
class Deployment < ActiveRecord::Base
include InternalId
belongs_to :project, required: true
belongs_to :environment, required: true
belongs_to :project, validate: true
belongs_to :environment, validate: true
belongs_to :user
belongs_to :deployable, polymorphic: true
......
......@@ -7,8 +7,8 @@ class AddDeployments < ActiveRecord::Migration
def change
create_table :deployments, force: true do |t|
t.integer :iid, null: false
t.integer :project_id
t.integer :environment_id
t.integer :project_id, null: false
t.integer :environment_id, null: false
t.string :ref, null: false
t.boolean :tag, null: false
t.string :sha, null: false
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment