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:
authorJarka Kadlecová <jarka@gitlab.com>2018-01-04 15:29:48 +0300
committerJarka Kadlecová <jarka@gitlab.com>2018-01-05 12:12:14 +0300
commit304851dc90c06d770042bf3cb0af887b6f3497e4 (patch)
tree2942940382a5aef1a155b2490f7a28ac6417680f /app/models/issue.rb
parent1560c234d2410ccbd163b9aedecf2d8b7a596627 (diff)
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