|
|
@@ -15,21 +15,21 @@ |
|
|
|
# along with this program; if not, write to the Free Software |
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
|
|
|
|
|
|
# Class used to represent the relations of an issue |
|
|
|
class IssueRelations < Array |
|
|
|
include Redmine::I18n |
|
|
|
|
|
|
|
def initialize(issue, *args) |
|
|
|
@issue = issue |
|
|
|
super(*args) |
|
|
|
end |
|
|
|
|
|
|
|
def to_s(*args) |
|
|
|
map {|relation| "#{l(relation.label_for(@issue))} ##{relation.other_issue(@issue).id}"}.join(', ') |
|
|
|
class IssueRelation < ActiveRecord::Base |
|
|
|
# Class used to represent the relations of an issue |
|
|
|
class Relations < Array |
|
|
|
include Redmine::I18n |
|
|
|
|
|
|
|
def initialize(issue, *args) |
|
|
|
@issue = issue |
|
|
|
super(*args) |
|
|
|
end |
|
|
|
|
|
|
|
def to_s(*args) |
|
|
|
map {|relation| "#{l(relation.label_for(@issue))} ##{relation.other_issue(@issue).id}"}.join(', ') |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
class IssueRelation < ActiveRecord::Base |
|
|
|
belongs_to :issue_from, :class_name => 'Issue', :foreign_key => 'issue_from_id' |
|
|
|
belongs_to :issue_to, :class_name => 'Issue', :foreign_key => 'issue_to_id' |
|
|
|
|