From 304851dc90c06d770042bf3cb0af887b6f3497e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarka=20Kadlecova=CC=81?= Date: Thu, 4 Jan 2018 13:29:48 +0100 Subject: Refactor RelativePositioning so that it can be used by other classes --- app/models/issue.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/issue.rb') 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 -- cgit v1.2.1