Commit cff9ff4b authored by Jan Provaznik's avatar Jan Provaznik

EE fixes

parent 09348ff8
class ResourceLabelEvent < ActiveRecord::Base
prepend EE::ResourceLabelEvent
ISSUABLE_COLUMNS = %i(issue_id merge_request_id).freeze
belongs_to :user
......
......@@ -8,6 +8,7 @@ class CreateResourceLabelEvents < ActiveRecord::Migration
t.integer :action, null: false
t.references :issue, null: true, index: true, foreign_key: { on_delete: :cascade }
t.references :merge_request, null: true, index: true, foreign_key: { on_delete: :cascade }
t.references :epic, null: true, index: true, foreign_key: { on_delete: :cascade }
t.references :label, index: true, foreign_key: { on_delete: :nullify }
t.references :user, index: true, foreign_key: { on_delete: :nullify }
t.datetime_with_timezone :created_at, null: false
......
......@@ -2361,11 +2361,13 @@ ActiveRecord::Schema.define(version: 20180726172057) do
t.integer "action", null: false
t.integer "issue_id"
t.integer "merge_request_id"
t.integer "epic_id"
t.integer "label_id"
t.integer "user_id"
t.datetime_with_timezone "created_at", null: false
end
add_index "resource_label_events", ["epic_id"], name: "index_resource_label_events_on_epic_id", using: :btree
add_index "resource_label_events", ["issue_id"], name: "index_resource_label_events_on_issue_id", using: :btree
add_index "resource_label_events", ["label_id"], name: "index_resource_label_events_on_label_id", using: :btree
add_index "resource_label_events", ["merge_request_id"], name: "index_resource_label_events_on_merge_request_id", using: :btree
......@@ -3031,6 +3033,7 @@ ActiveRecord::Schema.define(version: 20180726172057) do
add_foreign_key "push_rules", "projects", name: "fk_83b29894de", on_delete: :cascade
add_foreign_key "releases", "projects", name: "fk_47fe2a0596", on_delete: :cascade
add_foreign_key "remote_mirrors", "projects", name: "fk_43a9aa4ca8", on_delete: :cascade
add_foreign_key "resource_label_events", "epics", on_delete: :cascade
add_foreign_key "resource_label_events", "issues", on_delete: :cascade
add_foreign_key "resource_label_events", "labels", on_delete: :nullify
add_foreign_key "resource_label_events", "merge_requests", on_delete: :cascade
......
......@@ -9,6 +9,7 @@ module EE
include Noteable
include Referable
include Awardable
include LabelEventable
belongs_to :assignee, class_name: "User"
belongs_to :group
......
module EE
module ResourceLabelEvent
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
EE_ISSUABLE_COLUMNS = %i(epic_id).freeze
override :issuable
def issuable
epic || super
end
override :issuable_columns
def issuable_columns
EE_ISSUABLE_COLUMNS + super
end
end
end
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