Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/resource_state_event.rb')
-rw-r--r--app/models/resource_state_event.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/resource_state_event.rb b/app/models/resource_state_event.rb
index 689a9d8a8ae..6ebb9d5f176 100644
--- a/app/models/resource_state_event.rb
+++ b/app/models/resource_state_event.rb
@@ -3,8 +3,9 @@
class ResourceStateEvent < ResourceEvent
include IssueResourceEvent
include MergeRequestResourceEvent
+ include Importable
- validate :exactly_one_issuable
+ validate :exactly_one_issuable, unless: :importing?
belongs_to :source_merge_request, class_name: 'MergeRequest', foreign_key: :source_merge_request_id
@@ -32,9 +33,9 @@ class ResourceStateEvent < ResourceEvent
case state
when 'closed'
- issue_usage_counter.track_issue_closed_action(author: user)
+ issue_usage_counter.track_issue_closed_action(author: user, project: issue.project)
when 'reopened'
- issue_usage_counter.track_issue_reopened_action(author: user)
+ issue_usage_counter.track_issue_reopened_action(author: user, project: issue.project)
else
# no-op, nothing to do, not a state we're tracking
end