diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/issue.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 972bf0135..0d2d6fc0d 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -54,6 +54,13 @@ class Issue < ActiveRecord::Base end end + def copy_from(arg) + issue = arg.is_a?(Issue) ? arg : Issue.find(arg) + self.attributes = issue.attributes.dup + self.custom_values = issue.custom_values.collect {|v| v.clone} + self + end + def priority_id=(pid) self.priority = nil write_attribute(:priority_id, pid) |