Rates are now copied during Project#copy.
This commit is contained in:
1 parent
4666ddb10e
commit
b521b487ad
1 file changed
+13
@@ -83,5 +83,18 @@ class RateProjectHook < Redmine::Hook::ViewListener
|
|||||||
end
|
end
|
||||||
return content_tag(:td, content, :align => 'left', :id => "rate_#{project.id}_#{member.user.id}" )
|
return content_tag(:td, content, :align => 'left', :id => "rate_#{project.id}_#{member.user.id}" )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def model_project_copy_before_save(context = {})
|
||||||
|
source = context[:source_project]
|
||||||
|
destination = context[:destination_project]
|
||||||
|
|
||||||
|
Rate.find(:all, :conditions => {:project_id => source.id}).each do |source_rate|
|
||||||
|
destination_rate = Rate.new
|
||||||
|
|
||||||
|
destination_rate.attributes = source_rate.attributes.except("project_id")
|
||||||
|
destination_rate.project = destination
|
||||||
|
destination_rate.save # Need to save here because there is no relation on project to rate
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Reference in new issue
Block a user