summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJarka Kadlecová <jarka@gitlab.com>2018-01-04 13:29:48 +0100
committerJarka Kadlecová <jarka@gitlab.com>2018-01-05 10:12:14 +0100
commit304851dc90c06d770042bf3cb0af887b6f3497e4 (patch)
tree2942940382a5aef1a155b2490f7a28ac6417680f /app/models/issue.rb
parent1560c234d2410ccbd163b9aedecf2d8b7a596627 (diff)
downloadgitlab-ce-304851dc90c06d770042bf3cb0af887b6f3497e4.tar.gz
Refactor RelativePositioning so that it can be used by other classes
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 4eafc1316d6..f2d111ba926 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -35,6 +35,8 @@ class Issue < ActiveRecord::Base
validates :project, presence: true
+ alias_attribute :parent_id, :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)') }
@@ -78,6 +80,10 @@ class Issue < ActiveRecord::Base
acts_as_paranoid
+ class << self
+ alias_method :in_parents, :in_projects
+ end
+
def self.reference_prefix
'#'
end