Skip to content

Commit 3d3a73a

Browse files
author
Tom Copeland
committed
Implementing artifact_file conversion
1 parent 41ea274 commit 3d3a73a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/tasks/gforge_models.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class GForgeSupportedLanguage < GForgeTable
108108
set_primary_key 'language_id'
109109
set_table_name 'supported_languages'
110110
end
111-
111+
112112
class GForgeArtifactGroupList < GForgeTable
113113
set_primary_key 'group_artifact_id'
114114
set_table_name 'artifact_group_list'
@@ -155,6 +155,11 @@ def convert_to_redmine_journal_on(issue)
155155
Journal.create!(:journalized_type => "Issue", :journalized_id => issue.id, :user => create_or_fetch_user(user), :notes => body, :created_on => Time.at(adddate))
156156
end
157157
end
158+
159+
class GForgeArtifactFile < GForgeTable
160+
set_table_name 'artifact_file'
161+
belongs_to :artifact, :class_name => "GForgeArtifact", :foreign_key => 'artifact_id'
162+
end
158163

159164
class GForgeArtifact < GForgeTable
160165
# TODO it looks like the Redmine equivalent of artifact_history is the combination of journal and journal entries. Is it worthwhile to migrate over that data?
@@ -166,6 +171,7 @@ class GForgeArtifact < GForgeTable
166171
belongs_to :category, :class_name => "GForgeArtifactCategory", :foreign_key => 'category_id'
167172
has_many :monitors, :class_name => "GForgeArtifactMonitor", :foreign_key => 'artifact_id'
168173
has_many :messages, :class_name => "GForgeArtifactMessage", :foreign_key => 'artifact_id'
174+
has_many :files, :class_name => "GForgeArtifactFile", :foreign_key => 'artifact_id'
169175
def convert_to_redmine_issue_in(project)
170176
# I don't see a Redmine equivalent for these fields: resolution_id, close_date
171177
issue = Issue.new(

0 commit comments

Comments
 (0)