diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-01-12 19:43:38 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-01-12 19:43:38 +0800 |
commit | cfd75101d19db3235b64b05d7a58616db40f22c6 (patch) | |
tree | 6eef1dd8bd6a1ddc8f69ffdf35bf2f9b6771c30c /app/models/issue.rb | |
parent | f4bd9c0b5e1eafe6de855d73bfb606909229f382 (diff) | |
parent | f9579df8617add53424f57c0feedfa601a77e923 (diff) | |
download | gitlab-ce-cfd75101d19db3235b64b05d7a58616db40f22c6.tar.gz |
Merge remote-tracking branch 'upstream/master' into 1819-override-ce
* upstream/master: (621 commits)
Add a note about GitLab QA page objects validator to docs
Refactor dispatcher projects blame and blob path
Update export message to mention we can download the file from the UI
Fix Ctrl+Enter keyboard shortcut saving comment/note edit
fix case where tooltip messes up :last-child selector
Add reason to keep postgresql 9.2 for CI
Remove warning noise in ProjectImportOptions
Add changelog entry
Add RedirectRoute factory
Update Ingress extra cost note to be more generic
Fix Rubocop offense
Refactor dispatcher project branches path
Revert "Revert "Fix Route validation for unchanged path""
Document that we need rsync for backing up
Docs: move article "Laravel and Envoy w/ CI/CD"
Recommend against the use of EFS
Adds Rubocop rule for line break around conditionals
Update CHANGELOG.md for 10.1.6
Filter out build traces from logged parameters
Refactored project:n* imports in dispatcher.js
...
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index dc64888b6fc..93628b456f2 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -12,7 +12,7 @@ class Issue < ActiveRecord::Base include ThrottledTouch include IgnorableColumn - ignore_column :assignee_id, :branch_name + ignore_column :assignee_id, :branch_name, :deleted_at DueDateStruct = Struct.new(:title, :name).freeze NoDueDate = DueDateStruct.new('No Due Date', '0').freeze @@ -35,6 +35,8 @@ class Issue < ActiveRecord::Base validates :project, presence: true + alias_attribute :parent_ids, :project_id + scope :in_projects, ->(project_ids) { where(project_id: project_ids) } scope :assigned, -> { where('EXISTS (SELECT TRUE FROM issue_assignees WHERE issue_id = issues.id)') } @@ -76,7 +78,9 @@ class Issue < ActiveRecord::Base end end - acts_as_paranoid + class << self + alias_method :in_parents, :in_projects + end def self.reference_prefix '#' @@ -276,6 +280,11 @@ class Issue < ActiveRecord::Base private + def ensure_metrics + super + metrics.record! + end + # Returns `true` if the given User can read the current Issue. # # This method duplicates the same check of issue_policy.rb |