end
def copy
-
if params[:source_tracker_id].blank? || params[:source_tracker_id] == 'any'
@source_tracker = nil
else
else
@source_role = Role.find_by_id(params[:source_role_id].to_i)
end
-
- @target_trackers = params[:target_tracker_ids].blank? ? nil : Tracker.find_all_by_id(params[:target_tracker_ids])
- @target_roles = params[:target_role_ids].blank? ? nil : Role.find_all_by_id(params[:target_role_ids])
-
+ @target_trackers = params[:target_tracker_ids].blank? ?
+ nil : Tracker.where(:id => params[:target_tracker_ids]).all
+ @target_roles = params[:target_role_ids].blank? ?
+ nil : Role.where(:id => params[:target_role_ids])
if request.post?
if params[:source_tracker_id].blank? || params[:source_role_id].blank? || (@source_tracker.nil? && @source_role.nil?)
flash.now[:error] = l(:error_workflow_copy_source)